Skip to content

Commit f7384c6

Browse files
authored
chore: update release workflow name and refine tag creation process (#4)
* fix: update release workflow name and refine tag creation process * format * chore: remove hardcoded Go version and use go.mod for versioning in workflows * chore: remove unnecessary blank line in go-test workflow * fix: correct tag pattern in release workflow to include 'v' prefix * chore: update Ubuntu version in build matrix to 24.04 * chore: revert Ubuntu version in build matrix to 22.04 * fix: enhance release task to validate version format and improve tagging process * fix: validate version format in release tagging process
1 parent 9a422b7 commit f7384c6

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

.github/workflows/go-test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
pull_request:
77
branches: [main]
88

9-
env:
10-
GO_VERSION: "1.25.1"
11-
129
jobs:
1310
go-test:
1411
runs-on: ubuntu-latest
@@ -19,7 +16,7 @@ jobs:
1916
- name: Set up Go
2017
uses: actions/setup-go@v5
2118
with:
22-
go-version: ${{ env.GO_VERSION }}
19+
go-version-file: go.mod
2320

2421
- name: Run tests
2522
run: go tool task test

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
name: Release arduino-app
1+
name: Release arduino-router
22

33
on:
44
push:
55
tags:
6-
- "*" # Trigger on all tags
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
77

88
env:
9-
GO_VERSION: "1.25.1"
109
PROJECT_NAME: "arduino-router"
1110
GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }}
1211
GITHUB_USERNAME: ArduinoBot
@@ -34,7 +33,7 @@ jobs:
3433
- name: Set up Go
3534
uses: actions/setup-go@v5
3635
with:
37-
go-version: ${{ env.GO_VERSION }}
36+
go-version-file: go.mod
3837

3938
- name: Build deb
4039
run: |

Taskfile.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ tasks:
6262
vars:
6363
ARCH: '{{.ARCH | default "arm64"}}'
6464

65+
release:
66+
desc: Create a tag on the current commit and push it to the remote to create the release
67+
cmds:
68+
- echo "Create tag version {{ .TAG }}"
69+
- git tag "{{ .TAG }}"
70+
- git push origin "{{ .TAG }}"
71+
vars:
72+
TAG:
73+
sh: |
74+
TAGARG="{{.CLI_ARGS}}"
75+
if ! echo "$TAGARG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+.*$'; then
76+
echo "Error: Version must match pattern 'v[0-9]+.[0-9]+.[0-9]+*'"
77+
echo " Invalid version: $TAGARG"
78+
echo " Valid examples: v1.0.0, v2.1.3, v1.0.0-beta, v3.2.1-rc.1"
79+
exit 1
80+
fi
81+
echo $TAGARG
6582
board:install:
6683
desc: Install arduino-router on the board
6784
interactive: true

0 commit comments

Comments
 (0)