Skip to content

Commit 4ecbb17

Browse files
committed
ci: automate release and tag bumping on main push
1 parent 9f45b26 commit 4ecbb17

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,32 @@ name: Release Rust Binaries
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches:
6+
- main
77
workflow_dispatch:
88

99
permissions:
1010
contents: write
1111

1212
jobs:
13+
bump_version:
14+
name: Bump Version and Tag
15+
runs-on: ubuntu-latest
16+
outputs:
17+
new_tag: ${{ steps.tag_version.outputs.new_tag }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Bump version and push tag
22+
id: tag_version
23+
uses: mathieudutour/github-tag-action@v6.2
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
default_bump: patch
27+
1328
build:
1429
name: Build on ${{ matrix.os }}
30+
needs: bump_version
1531
runs-on: ${{ matrix.os }}
1632
strategy:
1733
matrix:
@@ -47,7 +63,7 @@ jobs:
4763
run: cp target/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
4864

4965
- name: Upload to Release
50-
if: startsWith(github.ref, 'refs/tags/')
5166
uses: softprops/action-gh-release@v2
5267
with:
68+
tag_name: ${{ needs.bump_version.outputs.new_tag }}
5369
files: ${{ matrix.asset_name }}

0 commit comments

Comments
 (0)