File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : release
2+ on :
3+ push :
4+ tags :
5+ - " v*"
6+ workflow_dispatch :
7+ inputs :
8+ release_version :
9+ description : " Release version"
10+ required : true
11+ default : " "
12+ create_release :
13+ description : " Create release"
14+ required : true
15+ default : " true"
16+ upload_artifacts :
17+ description : " Upload artifacts"
18+ required : true
19+ default : " true"
20+
21+ env :
22+ BIN_NAME : iroh-c-ffi
23+ IROH_FORCE_STAGING_RELAYS : " 1"
24+
25+ jobs :
26+ create-release :
27+ name : create-release
28+ runs-on : ubuntu-latest
29+ outputs :
30+ upload_url : ${{ steps.release.outputs.upload_url }}
31+ release_version : ${{ env.RELEASE_VERSION }}
32+ steps :
33+ - name : Get the release version from the tag (push)
34+ shell : bash
35+ if : env.RELEASE_VERSION == '' && github.event_name == 'push'
36+ run : |
37+ # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
38+ echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
39+ echo "version is: ${{ env.RELEASE_VERSION }}"
40+ - name : Get the release version from the tag (dispatch)
41+ shell : bash
42+ if : github.event_name == 'workflow_dispatch'
43+ run : |
44+ echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV
45+ echo "version is: ${{ env.RELEASE_VERSION }}"
46+ - name : Checkout repository
47+ uses : actions/checkout@v4
48+ with :
49+ fetch-depth : 1
50+ - name : Create GitHub release
51+ id : release
52+ if : github.event.inputs.create_release == 'true' || github.event_name == 'push'
53+ uses : actions/create-release@v1
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ with :
57+ tag_name : ${{ env.RELEASE_VERSION }}
58+ release_name : ${{ env.RELEASE_VERSION }}
You can’t perform that action at this time.
0 commit comments