diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..ebfd988d --- /dev/null +++ b/.github/workflows/publish.yaml @@ -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 }} diff --git a/MAINTENANCE.md b/MAINTENANCE.md index d62232fc..2ddd64f7 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -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 -x`. diff --git a/rspirv/release.toml b/rspirv/release.toml index f8308abf..f7a01d2a 100644 --- a/rspirv/release.toml +++ b/rspirv/release.toml @@ -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}}\""}, -] \ No newline at end of file +] diff --git a/spirv/release.toml b/spirv/release.toml index e1f4c5e4..17ce3028 100644 --- a/spirv/release.toml +++ b/spirv/release.toml @@ -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\" }" }, ] - -