Skip to content

Commit

Permalink
ci: add publishing workflow (triggered by tags) (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
msiglreith authored Dec 18, 2023
1 parent c16591f commit 06533f2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish

on:
push:
tags:
paths: "**/Cargo.toml"

concurrency:
group: ${{ github.sha }}
cancel-in-progress: true

jobs:
Publish:
if: github.repository_owner == 'gfx-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish spirv
run: cargo publish --manifest-path spirv/Cargo.toml --token ${{ secrets.cratesio_token }}
- name: Publish rspirv
run: cargo publish --manifest-path rspirv/Cargo.toml --token ${{ secrets.cratesio_token }}
10 changes: 7 additions & 3 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Prerequisites

`rspirv` uses `cargo-release` for release management. If you don't have `cargo-release` installed run `cargo install cargo-release`. Publishing to crates.io is handled by a github workflow.

# Making a new release

1. If you don't have cargo-release installed run `cargo install cargo-release`
1. To prevent breakage, one should release `spirv` before releasing a new `rspirv` because it has an obvious dependency.
1. For `rspirv` run `cargo release` in the `rspirv` directory, this should follow Semantic Versioning
Order of releases crates is important to prevent breakage. `spirv` should released before `rspirv` because it has an obvious dependency.

In the corresponding crate directory execute `cargo release <version> -x`.
3 changes: 2 additions & 1 deletion rspirv/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ tag-message = "Release {{crate_name}} {{version}}"
tag-name = "{{crate_name}}-{{version}}"
sign-commit = true
sign-tag = true
publish = false

pre-release-replacements = [
{file="README.md", search="rspirv = .*", replace="{{crate_name}} = \"{{version}}\""},
]
]
3 changes: 1 addition & 2 deletions spirv/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ tag-message = "Release {{crate_name}} {{version}}"
tag-name = "{{crate_name}}-{{version}}"
sign-commit = true
sign-tag = true
publish = false

pre-release-replacements = [
{file="README.md", search="spirv = .*", replace="{{crate_name}} = \"{{version}}\""},
{file="../rspirv/Cargo.toml", search="spirv = \\{ version = \".*\", path = \"../spirv\" \\}", replace="{{crate_name}} = { version = \"{{version}}\", path = \"../spirv\" }" },
]


0 comments on commit 06533f2

Please sign in to comment.