From a22dc9be1b4c17a0c37d0d228cfb74b5949deda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Sun, 15 Sep 2024 11:04:44 +0200 Subject: [PATCH] do not hardcode go version --- .github/workflows/ci.yml | 10 +++++++--- .github/workflows/golangci-lint.yml | 13 ++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c8a13d5..0777bf56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: BOTO_CONFIG: /dev/null GO111MODULE: "on" GOPROXY: "https://proxy.golang.org" - GOVER: '1.19' steps: - name: "Install packages" @@ -42,10 +41,15 @@ jobs: # fetch the whole repo for `git describe` to work fetch-depth: 0 + - name: "Read go version from go.mod" + run: | + echo "GOVER=$(sed -n 's/^go \(.*\)/\1/p' go.mod)" >> $GITHUB_OUTPUT + id: goversion + - name: "Setup Go" uses: actions/setup-go@v3 with: - go-version: ${{ env.GOVER }} + go-version: ${{ steps.goversion.outputs.GOVER }} - name: "Get aptly version" run: | @@ -101,7 +105,7 @@ jobs: strategy: fail-fast: false matrix: - name: ["Debian 12", "Debian 11", "Debian 10", "Ubuntu 22.04", "Ubuntu 20.04"] + name: ["Debian 12", "Debian 11", "Debian 10", "Ubuntu 24.04", "Ubuntu 22.04", "Ubuntu 20.04"] include: - name: "Debian 12" suite: bookworm diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 837e8cb9..a3d8666b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,10 +16,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + + - name: "Read go version from go.mod" + run: | + echo "GOVER=$(sed -n 's/^go \(.*\)/\1/p' go.mod)" >> $GITHUB_OUTPUT + id: goversion + + - name: "Setup Go" + uses: actions/setup-go@v3 with: - go-version: '1.19' - cache: false + go-version: ${{ steps.goversion.outputs.GOVER }} + - name: Create VERSION file run: | make -s version | tr -d '\n' > VERSION