diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index f0de1b1..3c9c446 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -6,9 +6,6 @@ on: pull_request: branches: [main] -env: - GO_VERSION: "1.25.1" - jobs: go-test: runs-on: ubuntu-latest @@ -19,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Run tests run: go tool task test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c30773f..12312da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,11 @@ -name: Release arduino-app +name: Release arduino-router on: push: tags: - - "*" # Trigger on all tags + - "v[0-9]+.[0-9]+.[0-9]+*" env: - GO_VERSION: "1.25.1" PROJECT_NAME: "arduino-router" GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }} GITHUB_USERNAME: ArduinoBot @@ -34,7 +33,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Build deb run: | diff --git a/Taskfile.yml b/Taskfile.yml index 4d274e6..91323c0 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -62,6 +62,23 @@ tasks: vars: ARCH: '{{.ARCH | default "arm64"}}' + release: + desc: Create a tag on the current commit and push it to the remote to create the release + cmds: + - echo "Create tag version {{ .TAG }}" + - git tag "{{ .TAG }}" + - git push origin "{{ .TAG }}" + vars: + TAG: + sh: | + TAGARG="{{.CLI_ARGS}}" + if ! echo "$TAGARG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+.*$'; then + echo "Error: Version must match pattern 'v[0-9]+.[0-9]+.[0-9]+*'" + echo " Invalid version: $TAGARG" + echo " Valid examples: v1.0.0, v2.1.3, v1.0.0-beta, v3.2.1-rc.1" + exit 1 + fi + echo $TAGARG board:install: desc: Install arduino-router on the board interactive: true