From 9ba94305d4af8e9919d43684cb4d1a71a882b0ee Mon Sep 17 00:00:00 2001 From: David Stangl Date: Mon, 13 Feb 2023 14:30:41 +0100 Subject: [PATCH 1/3] Add release pipeline --- .github/workflows/publish.yaml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 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 0000000..40e3188 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,48 @@ +name: Publish + +on: + push: + branches: + - main + +jobs: + release-on-push: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Calculate next version + id: calc-version + uses: rymndhng/release-on-push-action@master + with: + bump_version_scheme: norelease + tag_prefix: "" + dry_run: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set version + run: | + sed -i "s/^version = \".*\"$/version = \"${{ steps.calc-version.outputs.version }}\"/" Cargo.toml + - name: Publish new version to main + run: | + git config --global user.email "rust-maintainers@moia.io" + git config --global user.name "MOIA Rust Maintainers" + git commit -am "Release ${{ steps.calc-version.outputs.version }}" + git push + - name: Create github release + uses: rymndhng/release-on-push-action@master + with: + bump_version_scheme: norelease + tag_prefix: "" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Login to crates.io + run: cargo login "${{ secrets.CRATES_IO_TOKEN }}" + - name: Publish + run: cargo publish From e494fa48691594db612e95c920313e84c1d7ec83 Mon Sep 17 00:00:00 2001 From: David Stangl Date: Tue, 14 Feb 2023 13:39:54 +0100 Subject: [PATCH 2/3] Use cargo token from github secrets --- .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 40e3188..65728df 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -42,7 +42,7 @@ jobs: tag_prefix: "" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Login to crates.io - run: cargo login "${{ secrets.CRATES_IO_TOKEN }}" - name: Publish run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 2e0155a3429e908aca3d8c16d8f11e72eb6b16d9 Mon Sep 17 00:00:00 2001 From: David Stangl Date: Tue, 14 Feb 2023 13:41:38 +0100 Subject: [PATCH 3/3] Fix email address --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 65728df..4966d77 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -31,7 +31,7 @@ jobs: sed -i "s/^version = \".*\"$/version = \"${{ steps.calc-version.outputs.version }}\"/" Cargo.toml - name: Publish new version to main run: | - git config --global user.email "rust-maintainers@moia.io" + git config --global user.email "rust-maintainers@moiaorg.onmicrosoft.com" git config --global user.name "MOIA Rust Maintainers" git commit -am "Release ${{ steps.calc-version.outputs.version }}" git push