File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Release
22
3- # Publishes a GitHub release for a version tag, with the matching section of
4- # CHANGELOG.md as notes and a zip of the site ready to host.
3+ # Publishes a GitHub release for a version, with the matching section of
4+ # CHANGELOG.md as notes and a zip of the site ready to host. Runs when a version
5+ # tag is pushed, or by hand, in which case the tag is created on `target`.
56on :
67 push :
78 tags : ['v*']
89 workflow_dispatch :
910 inputs :
1011 tag :
11- description : Tag to publish (e.g. v0.1 .0)
12+ description : Version tag (e.g. v0.2 .0)
1213 required : true
14+ target :
15+ description : Branch or full commit SHA to tag
16+ required : true
17+ default : main
1318
1419permissions :
1520 contents : write
3742 env :
3843 GH_TOKEN : ${{ github.token }}
3944 TAG : ${{ inputs.tag || github.ref_name }}
45+ TARGET : ${{ inputs.target || github.sha }}
4046 run : |
41- git archive --format=zip --prefix="sinklink-$TAG/" -o "sinklink-$TAG.zip" "$TAG" \
47+ commit=$(git rev-parse --verify "$TARGET^{commit}")
48+ git archive --format=zip --prefix="sinklink-$TAG/" -o "sinklink-$TAG.zip" "$commit" \
4249 index.html styles src assets LICENSE README.md
4350 gh release create "$TAG" "sinklink-$TAG.zip" \
44- --verify-tag --title "SinkLink $TAG" --notes-file notes.md
51+ --target "$commit" --title "SinkLink $TAG" --notes-file notes.md
You can’t perform that action at this time.
0 commit comments