File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Release Build
22
33on :
44 push :
5+ branches :
6+ - master
57 tags :
68 - " *"
79
@@ -12,10 +14,31 @@ jobs:
1214 steps :
1315 - name : Checkout repository
1416 uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Extract version from manifest
21+ id : manifest_version
22+ run : |
23+ VERSION=$(grep -oP '"version":\s*"\K[^"]+' src/manifest_firefox.json)
24+ echo "VERSION=v$VERSION" >> $GITHUB_OUTPUT
25+
26+ - name : Create and push tag
27+ if : github.ref == 'refs/heads/master'
28+ run : |
29+ git config user.name "github-actions[bot]"
30+ git config user.email "github-actions[bot]@users.noreply.github.com"
31+ git tag ${{ steps.manifest_version.outputs.VERSION }}
32+ git push origin ${{ steps.manifest_version.outputs.VERSION }}
1533
1634 - name : Get tag version
1735 id : tag
18- run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
36+ run : |
37+ if [ "${{ github.ref_type }}" == "tag" ]; then
38+ echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
39+ else
40+ echo "VERSION=${{ steps.manifest_version.outputs.VERSION }}" >> $GITHUB_OUTPUT
41+ fi
1942
2043 - name : Extract latest changelog
2144 id : changelog
You can’t perform that action at this time.
0 commit comments