From 6f920544d00a17db8b1fe5296213cf9abe3bc67e Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 13 Apr 2022 14:17:58 -0400 Subject: [PATCH 1/5] ci: Ensure we always check for latest version of Go --- .github/workflows/ci.yml | 1 + .github/workflows/cross-build.yml | 1 + .github/workflows/lint.yml | 1 + .github/workflows/release.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 424b5dd199c..0a8fcb1a865 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} + check-latest: true - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index 04c1d29afd2..2f9c9e35a60 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -24,6 +24,7 @@ jobs: uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} + check-latest: true - name: Print Go version and environment id: vars diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7376b910421..018e8aa6a0f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,6 +20,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version: 1.17 + check-latest: true - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68e231de9d0..f3146f7e9ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ jobs: uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} + check-latest: true - name: Checkout code uses: actions/checkout@v3 From 0af186e3a587ea7f9598d5904d5332375a7711fa Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 13 Apr 2022 14:27:52 -0400 Subject: [PATCH 2/5] Try to force 1.18.1, 1.17.9 --- .github/workflows/ci.yml | 2 +- .github/workflows/cross-build.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8fcb1a865..e023423e146 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - go: [ '1.17', '1.18' ] + go: [ '^1.17.9', '^1.18.1' ] # Set some variables per OS, usable via ${{ matrix.VAR }} # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index 2f9c9e35a60..5d689b0eb53 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: goos: ['android', 'linux', 'solaris', 'illumos', 'dragonfly', 'freebsd', 'openbsd', 'plan9', 'windows', 'darwin', 'netbsd'] - go: [ '1.18' ] + go: [ '^1.18.1' ] runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 018e8aa6a0f..01db816876d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: '^1.17.9' check-latest: true - name: golangci-lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3146f7e9ca..01d5f7abb57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - go: [ '1.18' ] + go: [ '>=1.18.1' ] runs-on: ${{ matrix.os }} steps: From 34d83afb400bf4bc1087080cd7a72f93509ab45e Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 13 Apr 2022 14:37:22 -0400 Subject: [PATCH 3/5] Use includes for the actual go semver --- .github/workflows/ci.yml | 14 +++++++++++--- .github/workflows/cross-build.yml | 11 +++++++++-- .github/workflows/release.yml | 11 +++++++++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e023423e146..ba15b9a5160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,20 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - go: [ '^1.17.9', '^1.18.1' ] + go: [ '1.17', '1.18' ] + + include: + # Set the minimum Go patch version for the given Go minor + # Usable via ${{ matrix.GO_SEMVER }} + - go: '1.17' + GO_SEMVER: '^1.17.9' + + - go: '1.18' + GO_SEMVER: '^1.18.1' # Set some variables per OS, usable via ${{ matrix.VAR }} # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing # SUCCESS: the typical value for $? per OS (Windows/pwsh returns 'True') - include: - os: ubuntu-latest CADDY_BIN_PATH: ./cmd/caddy/caddy SUCCESS: 0 @@ -43,7 +51,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: ${{ matrix.go }} + go-version: ${{ matrix.GO_SEMVER }} check-latest: true - name: Checkout code diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index 5d689b0eb53..2e9e2410f0b 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -16,14 +16,21 @@ jobs: fail-fast: false matrix: goos: ['android', 'linux', 'solaris', 'illumos', 'dragonfly', 'freebsd', 'openbsd', 'plan9', 'windows', 'darwin', 'netbsd'] - go: [ '^1.18.1' ] + go: [ '1.18' ] + + include: + # Set the minimum Go patch version for the given Go minor + # Usable via ${{ matrix.GO_SEMVER }} + - go: '1.18' + GO_SEMVER: '^1.18.1' + runs-on: ubuntu-latest continue-on-error: true steps: - name: Install Go uses: actions/setup-go@v3 with: - go-version: ${{ matrix.go }} + go-version: ${{ matrix.GO_SEMVER }} check-latest: true - name: Print Go version and environment diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01d5f7abb57..934dcf18671 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,14 +11,21 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - go: [ '>=1.18.1' ] + go: [ '1.18' ] + + include: + # Set the minimum Go patch version for the given Go minor + # Usable via ${{ matrix.GO_SEMVER }} + - go: '1.17' + GO_SEMVER: '^1.18.1' + runs-on: ${{ matrix.os }} steps: - name: Install Go uses: actions/setup-go@v3 with: - go-version: ${{ matrix.go }} + go-version: ${{ matrix.GO_SEMVER }} check-latest: true - name: Checkout code From 0e96e2e909ae2cdb0857e171bf9cc79409f095c0 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 13 Apr 2022 14:42:34 -0400 Subject: [PATCH 4/5] Use `~` for semver here, apparently --- .github/workflows/ci.yml | 4 ++-- .github/workflows/cross-build.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba15b9a5160..5a79fcd55ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,10 @@ jobs: # Set the minimum Go patch version for the given Go minor # Usable via ${{ matrix.GO_SEMVER }} - go: '1.17' - GO_SEMVER: '^1.17.9' + GO_SEMVER: '~1.17.9' - go: '1.18' - GO_SEMVER: '^1.18.1' + GO_SEMVER: '~1.18.1' # Set some variables per OS, usable via ${{ matrix.VAR }} # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index 2e9e2410f0b..3ac9548f5fc 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -22,7 +22,7 @@ jobs: # Set the minimum Go patch version for the given Go minor # Usable via ${{ matrix.GO_SEMVER }} - go: '1.18' - GO_SEMVER: '^1.18.1' + GO_SEMVER: '~1.18.1' runs-on: ubuntu-latest continue-on-error: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 01db816876d..0aae6196654 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '^1.17.9' + go-version: '~1.17.9' check-latest: true - name: golangci-lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 934dcf18671..6d0fe7c55eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: # Set the minimum Go patch version for the given Go minor # Usable via ${{ matrix.GO_SEMVER }} - go: '1.17' - GO_SEMVER: '^1.18.1' + GO_SEMVER: '~1.18.1' runs-on: ${{ matrix.os }} From 316aba1c90281368732c9af42e388a5a715294de Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 13 Apr 2022 14:45:08 -0400 Subject: [PATCH 5/5] Try to make tests still run on 1.18.0 for Mac, for now --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a79fcd55ba..bc9e0a0c83f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,11 @@ jobs: - go: '1.18' GO_SEMVER: '~1.18.1' + # Go 1.18.1 isn't released yet for Mac as of Apr 13 2022 + - go: '1.18' + os: 'macos-latest' + GO_SEMVER: '1.18.0' + # Set some variables per OS, usable via ${{ matrix.VAR }} # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing # SUCCESS: the typical value for $? per OS (Windows/pwsh returns 'True')