Skip to content

Commit ced144c

Browse files
author
maizied.majumder
committed
Create release workflow for Linpad application
1 parent fbca2f3 commit ced144c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Linpad application"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
create_release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Get current version
17+
id: get_version
18+
run: |
19+
# Fetch the latest tag
20+
TAG=$(git describe --tags --abbrev=0)
21+
# Extract the version numbers
22+
VERSION=${TAG//v/}
23+
# Split into an array
24+
IFS='.' read -r -a VERSION_ARRAY <<< "$VERSION"
25+
# Increment the last digit for beta versions
26+
LAST=${VERSION_ARRAY[2]}
27+
NEW_LAST=$((LAST + 1))
28+
NEW_VERSION="v${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.$NEW_LAST-beta"
29+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
30+
31+
- name: Create Release
32+
uses: softprops/action-gh-release@v1
33+
with:
34+
tag_name: ${{ env.NEW_VERSION }}
35+
release_name: ${{ env.NEW_VERSION }}
36+
body: "Release of Linpad application version ${{ env.NEW_VERSION }}"
37+
files: output/linpad.deb
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)