From 2f22c52b125a8f41639f0ad3f8175809c6b61a93 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 27 Mar 2024 14:20:20 -0700 Subject: [PATCH] Split release and publish --- .github/workflows/build.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19ae4b4..130b7f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,8 @@ jobs: key: ubuntu-latest - run: cargo test - publish: + # Release xremap binaries on GitHub + release: runs-on: ubuntu-latest needs: - build @@ -75,9 +76,6 @@ jobs: profile: minimal toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 - with: - key: ubuntu-latest # Fetch x86_64 binary - { uses: actions/download-artifact@v3, with: { name: xremap-x86_64-x11, path: package/ } } @@ -105,6 +103,24 @@ jobs: GHR_VERSION: v0.16.2 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Publish xremap to crates.io + publish: + runs-on: ubuntu-latest + needs: + - build + - test + if: ${{ startsWith(github.ref, 'refs/tags/') }} + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v1 + with: + key: ubuntu-latest + # Release crate - name: cargo login run: cargo login "$CARGO_TOKEN"