File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ release :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Get tag
21+ id : tag
22+ run : |
23+ if [ ${{ github.ref }} == "refs/heads/main" ]; then
24+ echo "tag=latest" >> $GITHUB_OUTPUT
25+ else
26+ echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
27+ fi
28+
29+ - name : create a .tgz file
30+ run : |
31+ ls -la
32+ pwd
33+ tar czf /tmp/hetzner-install-image-${{ steps.tag.outputs.tag }}.tgz .
34+
35+ - name : upload artifact
36+ uses : actions/upload-artifact@v3
37+ with :
38+ path : /tmp/hetzner-install-image-${{ steps.tag.outputs.tag }}.tgz
39+
40+
41+ - name : upload release assets
42+ env :
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44+ run : |
45+ gh release create ${{ steps.tag.outputs.tag }} -t ${{ steps.tag.outputs.tag }} -n ""
46+ gh release upload ${{ steps.tag.outputs.tag }} /tmp/hetzner-install-image-${{ steps.tag.outputs.tag }}.tgz
You can’t perform that action at this time.
0 commit comments