-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 1.33 KB
/
release.yml
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
name: Automation to Make Releases
on:
push:
tags:
- 'v*.*.*'
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get current version
id: get_version
run: |
# Fetch the latest tag
TAG=$(git describe --tags --abbrev=0)
# Extract the version numbers
VERSION=${TAG//v/}
# Split into an array
IFS='.' read -r -a VERSION_ARRAY <<< "$VERSION"
# Increment the last digit for beta versions
LAST=${VERSION_ARRAY[2]}
NEW_LAST=$((LAST + 1))
NEW_VERSION="v${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.$NEW_LAST-beta"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.NEW_VERSION }}
name: ${{ steps.get_version.outputs.NEW_VERSION }}
body: "Release of Linpad application version ${{ steps.get_version.outputs.NEW_VERSION }}"
files: output/linpad.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}