Skip to content

Use go.mod as source of Go version number for workflows #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md
name: Check Go Dependencies

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.17"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -87,7 +83,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -146,7 +142,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-task.md
name: Check Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.17"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -75,7 +71,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -110,7 +106,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -152,7 +148,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -190,7 +186,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -223,7 +219,7 @@ jobs:

matrix:
module:
- path: ./
- path: .

steps:
- name: Checkout repository
Expand All @@ -232,7 +228,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Run go mod tidy
working-directory: ${{ matrix.module.path }}
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release-go-crosscompile-task.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/release-go-crosscompile-task.md
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"

env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: arduinoOTA
Expand All @@ -9,13 +14,6 @@ env:
# The project's folder on Arduino's download server for uploading builds
AWS_PLUGIN_TARGET: /arduinoOTA/
ARTIFACT_PREFIX: dist-
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.17"

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"

jobs:
create-release-artifacts:
Expand Down Expand Up @@ -64,7 +62,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
Loading