From ee61f63555d67b453d65094a7eda5171b1d76028 Mon Sep 17 00:00:00 2001 From: John Elizarraras Date: Fri, 12 Jan 2024 09:44:47 -0600 Subject: [PATCH] move release to separate workflow --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 28 --------------------- 2 files changed, 47 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c988e44 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + tags: + - '*' + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --all --verbose + + release: + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: build + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + - name: install cargo-release + uses: taiki-e/install-action@v2 + with: + tool: cargo-release + - name: cargo login + run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} + - name: "cargo release publish" + run: |- + cargo release \ + publish \ + --workspace \ + --all-features \ + --allow-branch HEAD \ + --no-confirm \ + --no-verify \ + --execute diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e1bfcc5..fefc8ae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,8 +3,6 @@ name: Rust on: push: branches: [ "master" ] - tags: - - '*' pull_request: branches: [ "master" ] @@ -22,29 +20,3 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --all --verbose - - release: - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" - needs: build - environment: release - permissions: - id-token: write - steps: - - uses: actions/checkout@v3 - - name: install cargo-release - uses: taiki-e/install-action@v2 - with: - tool: cargo-release - - name: cargo login - run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} - - name: "cargo release publish" - run: |- - cargo release \ - publish \ - --workspace \ - --all-features \ - --allow-branch HEAD \ - --no-confirm \ - --no-verify \ - --execute