Skip to content

Commit 8f4dcc7

Browse files
authored
Automate release (#14)
* Automate release * update * remove comment
1 parent 488050e commit 8f4dcc7

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: release
22

33
on:
44
push:
5-
# Sequence of patterns matched against refs/tags
5+
branches:
6+
- main
67
tags:
78
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
89

@@ -14,8 +15,27 @@ permissions:
1415
contents: write
1516

1617
jobs:
18+
version:
19+
name: Generate Version
20+
runs-on: ubuntu-latest
21+
outputs:
22+
version: ${{ steps.version.outputs.version }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Generate Version
29+
id: version
30+
uses: mathieudutour/[email protected]
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
default_bump: patch
34+
release_branches: main
35+
1736
build:
1837
name: Build
38+
needs: version
1939
runs-on: ${{ matrix.os }}
2040
strategy:
2141
matrix:
@@ -86,9 +106,9 @@ jobs:
86106

87107
release:
88108
name: Create Release
89-
needs: build
109+
needs: [build, version]
90110
runs-on: ubuntu-latest
91-
if: startsWith(github.ref, 'refs/tags/')
111+
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
92112

93113
steps:
94114
- name: Download all artifacts
@@ -97,6 +117,8 @@ jobs:
97117
- name: Create Release
98118
uses: softprops/action-gh-release@v1
99119
with:
120+
tag_name: v${{ needs.version.outputs.version }}
121+
name: Release v${{ needs.version.outputs.version }}
100122
files: |
101123
popcorn-cli-linux.tar.gz/popcorn-cli-linux.tar.gz
102124
popcorn-cli-windows.zip/popcorn-cli-windows.zip

0 commit comments

Comments
 (0)