@@ -33,12 +33,14 @@ jobs:
3333
3434 - name : Push tag
3535 if : steps.version-check.outputs.version != '0'
36+ id : push-tag
3637 run : |
3738 tag="v${{ steps.version-check.outputs.version }}"
3839 git config user.name "${GITHUB_ACTOR}"
3940 git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
4041 git tag -a "${tag}" -m "Release ${tag}"
4142 git push origin "${tag}"
43+ echo "tag_name=${tag}" >> $GITHUB_OUTPUT
4244
4345 - name : Checkout
4446 if : steps.version-check.outputs.version != '0'
@@ -56,16 +58,16 @@ jobs:
5658
5759 - name : Generate minimized HTML
5860 if : steps.version-check.outputs.version != '0'
59- run : cargo run --release -- ${{ github.action_path }}/ index.html ${{ github.action_path }}/ index.min.html
61+ run : cargo run --release -- index.html index.min.html
6062 shell : bash
6163 working-directory : ${{ github.action_path }}
6264
6365 - name : Copy files
6466 if : steps.version-check.outputs.version != '0'
6567 run : |
6668 mkdir -p ../release
67- cp -v ${{ github.action_path }}/ index.html ../release/
68- cp -v ${{ github.action_path }}/ index.min.html ./release/
69+ cp -v index.html ../release/
70+ cp -v index.min.html . ./release/
6971 shell : bash
7072 working-directory : ${{ github.action_path }}
7173
7577 with :
7678 generateReleaseNotes : true
7779 tag : " v${{ steps.version-check.outputs.version }}"
78- artifacts : " ${{ github.action_path }}/index.html,${{ github.action_path }}/index.min.html"
80+ artifacts : " ../release/index.html,../release/index.min.html"
81+
82+ - name : Delete tag on failure
83+ if : failure() && steps.push-tag.outputs.tag_name != ''
84+ run : |
85+ git config user.name "${GITHUB_ACTOR}"
86+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
87+ git push --delete origin "${{ steps.push-tag.outputs.tag_name }}"
88+ git tag -d "${{ steps.push-tag.outputs.tag_name }}"
0 commit comments