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"