From 05601b9fc780e2141e461b1d48e4ef0c83ddb996 Mon Sep 17 00:00:00 2001 From: msiglreith Date: Mon, 4 Dec 2023 20:52:55 +0100 Subject: [PATCH 1/3] ci: add publishing workflow (triggered by tags) --- .github/workflows/publish.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..d6de2a34 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,17 @@ +name: Publish + +on: + push: + tags: + - '*' + +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 }} \ No newline at end of file From 6e073d2caf5dcbc948ba3eedffa1332d3870e8ad Mon Sep 17 00:00:00 2001 From: msiglreith Date: Mon, 4 Dec 2023 22:06:24 +0100 Subject: [PATCH 2/3] ci: add cargo.toml trigger --- .github/workflows/publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d6de2a34..3d719198 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,7 +3,7 @@ name: Publish on: push: tags: - - '*' + paths: "**/Cargo.toml" jobs: Publish: @@ -14,4 +14,4 @@ jobs: - 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 }} \ No newline at end of file + run: cargo publish --manifest-path rspirv/Cargo.toml --token ${{ secrets.cratesio_token }} From 3c2ab4395c735e3c67123bb3ad553e6bb916c8cb Mon Sep 17 00:00:00 2001 From: msiglreith Date: Sun, 10 Dec 2023 17:03:47 +0100 Subject: [PATCH 3/3] Improve publishing workflow --- .github/workflows/publish.yaml | 4 ++++ MAINTENANCE.md | 10 +++++++--- rspirv/release.toml | 3 ++- spirv/release.toml | 3 +-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3d719198..ebfd988d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,6 +5,10 @@ on: tags: paths: "**/Cargo.toml" +concurrency: + group: ${{ github.sha }} + cancel-in-progress: true + jobs: Publish: if: github.repository_owner == 'gfx-rs' 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\" }" }, ] - -