Skip to content

Commit

Permalink
move release to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iblacksand committed Jan 12, 2024
1 parent 2f81467 commit ee61f63
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 28 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 0 additions & 28 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Rust
on:
push:
branches: [ "master" ]
tags:
- '*'
pull_request:
branches: [ "master" ]

Expand All @@ -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

0 comments on commit ee61f63

Please sign in to comment.