Skip to content

Commit a7bb9e5

Browse files
committed
Run release workflow directly on main pushes
1 parent fff9a6d commit a7bb9e5

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
name: Release
22

33
on:
4-
workflow_run:
5-
workflows:
6-
- CI
7-
types:
8-
- completed
4+
push:
95
branches:
106
- main
117
- master
8+
workflow_dispatch:
129

1310
permissions:
1411
contents: write
1512

1613
concurrency:
17-
group: release-${{ github.event.workflow_run.head_branch }}
14+
group: release-${{ github.ref_name }}
1815
cancel-in-progress: true
1916

2017
jobs:
2118
build-and-publish:
22-
if: github.event.workflow_run.conclusion == 'success'
2319
runs-on: windows-latest
2420

2521
steps:
26-
- name: Checkout successful CI commit
22+
- name: Checkout release commit
2723
uses: actions/checkout@v4
2824
with:
29-
ref: ${{ github.event.workflow_run.head_sha }}
3025
fetch-depth: 0
3126

3227
- name: Install stable toolchain
@@ -37,6 +32,15 @@ jobs:
3732
- name: Cache cargo
3833
uses: Swatinem/rust-cache@v2
3934

35+
- name: Format check
36+
run: cargo fmt --all --check
37+
38+
- name: Clippy
39+
run: cargo clippy --all-targets --all-features -- -D warnings
40+
41+
- name: Test
42+
run: cargo test --all-targets --all-features
43+
4044
- name: Read version metadata
4145
id: version
4246
shell: powershell
@@ -55,7 +59,7 @@ jobs:
5559
run: |
5660
git config user.name "github-actions[bot]"
5761
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
58-
git tag -f "${{ steps.version.outputs.tag }}" "${{ github.event.workflow_run.head_sha }}"
62+
git tag -f "${{ steps.version.outputs.tag }}" "${{ github.sha }}"
5963
git push origin "refs/tags/${{ steps.version.outputs.tag }}" --force
6064
6165
- name: Build release
@@ -88,7 +92,7 @@ jobs:
8892
uses: softprops/action-gh-release@v2
8993
with:
9094
tag_name: ${{ steps.version.outputs.tag }}
91-
target_commitish: ${{ github.event.workflow_run.head_sha }}
95+
target_commitish: ${{ github.sha }}
9296
files: |
9397
dist/*.zip
9498
dist/*.sha256

0 commit comments

Comments
 (0)