Skip to content

Commit 65a0fc1

Browse files
authored
Merge pull request #1 from kranurag7/kr/release-process
✨ create a release process
2 parents 85e93b4 + b670ba9 commit 65a0fc1

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

0 commit comments

Comments
 (0)