Skip to content

Commit 7bb3259

Browse files
authored
Merge pull request #252 from adakite1/artifacts-tag-push-release
Automatically create releases on tag push with artifacts as downloads.
2 parents 99882da + 8d986c8 commit 7bb3259

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CMake
22

33
on:
44
push:
5+
tags:
6+
- '*'
57
branches: [ master ]
68
pull_request:
79
branches: [ master ]
@@ -57,9 +59,27 @@ jobs:
5759
VERSION=$(git -C '${{github.workspace}}' describe --first-parent)
5860
PLATFORM=$(echo ${{matrix.config.name}} | tr '[:upper:]' '[:lower:'] | sed 's/ /_/g')
5961
echo "FILENAME=armips_${VERSION}_${PLATFORM}" >> $GITHUB_ENV
62+
echo "RELEASENAME=armips_${VERSION}" >> $GITHUB_ENV
6063
6164
- name: Upload
6265
uses: actions/upload-artifact@v4
6366
with:
6467
name: ${{env.FILENAME}}
6568
path: ${{github.workspace}}/install
69+
70+
- name: Archive Release
71+
uses: thedoctor0/zip-release@0.7.6
72+
if: startsWith(github.ref, 'refs/tags/')
73+
with:
74+
type: 'zip'
75+
filename: ${{env.FILENAME}}.zip
76+
directory: '${{github.workspace}}/install'
77+
78+
- name: Release
79+
uses: softprops/action-gh-release@v2
80+
if: startsWith(github.ref, 'refs/tags/')
81+
with:
82+
name: ${{env.RELEASENAME}}
83+
prerelease: true
84+
files: ${{github.workspace}}/install/${{env.FILENAME}}.zip
85+

0 commit comments

Comments
 (0)