-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.36 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release on Tag
on:
push:
tags:
- 'v*.*.*'
env:
VERSION:
permissions:
contents: write
actions: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout triggering tag
uses: actions/checkout@v4
- name: Setup Git
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Release and Upload Asset
uses: softprops/action-gh-release@v2
with:
files: 42free.sh
generate_release_notes: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Get the version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"
- name: Update version number in script
run: |
version=${{ env.VERSION }}
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
patch=$(echo $version | cut -d. -f3)
patch=$((patch + 1))
new_version="$major.$minor.$patch"
sed -i "s/^current_version=.*/current_version=\"$new_version\"/" 42free.sh
git add 42free.sh
git commit -m "bot: Update version number to $new_version"
git push origin main