From 50a600eef58908b394750b5136fc825fb0650d0e Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sat, 27 Dec 2025 10:34:26 +0100 Subject: [PATCH] .github/workflows: improve release reproducibility Remove the go-version-file test target, because it will just use the toolchain line. It's a bit unfortunate we lose coverage of a go.mod version that's older than oldstable, but that should not happen and it'd not be a supported Go version anyway. --- .github/workflows/LICENSE.suffix.txt | 30 ++++++++++++++++++++++++++++ .github/workflows/build.yml | 14 ++++++------- .github/workflows/test.yml | 4 ---- go.mod | 3 +++ 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/LICENSE.suffix.txt diff --git a/.github/workflows/LICENSE.suffix.txt b/.github/workflows/LICENSE.suffix.txt new file mode 100644 index 0000000..bc1f3f4 --- /dev/null +++ b/.github/workflows/LICENSE.suffix.txt @@ -0,0 +1,30 @@ + +--- + +Copyright 2009 The Go Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google LLC nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9611f0c..ea1f2bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,20 +26,18 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Install Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: 1.x + go-version-file: go.mod cache: false - name: Build binary run: | - cp LICENSE "$RUNNER_TEMP/LICENSE" - echo -e "\n---\n" >> "$RUNNER_TEMP/LICENSE" - curl -L "https://go.dev/LICENSE?m=text" >> "$RUNNER_TEMP/LICENSE" VERSION="$(git describe --tags)" DIR="$(mktemp -d)" mkdir "$DIR/age" - cp "$RUNNER_TEMP/LICENSE" "$DIR/age" go build -o "$DIR/age" -trimpath ./cmd/... + cp LICENSE "$DIR/age/LICENSE" + cat .github/workflows/LICENSE.suffix.txt >> "$DIR/age/LICENSE" if [ "$GOOS" == "windows" ]; then sudo apt-get update && sudo apt-get install -y osslsigncode if [ -n "${{ secrets.SIGN_PASS }}" ]; then @@ -77,9 +75,9 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Install Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: 1.x + go-version-file: go.mod cache: false - name: Create source tarball run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18c656e..7e2e5b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,6 @@ jobs: go: - { go-version: stable } - { go-version: oldstable } - - { go-version-file: go.mod } os: - ubuntu-latest - macos-latest @@ -28,7 +27,6 @@ jobs: - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go.go-version }} - go-version-file: ${{ matrix.go.go-version-file }} - run: | go test -race ./... test-latest: @@ -39,7 +37,6 @@ jobs: go: - { go-version: stable } - { go-version: oldstable } - - { go-version-file: go.mod } steps: - uses: actions/checkout@v5 with: @@ -47,7 +44,6 @@ jobs: - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go.go-version }} - go-version-file: ${{ matrix.go.go-version-file }} - uses: geomys/sandboxed-step@v1.2.1 with: run: | diff --git a/go.mod b/go.mod index 20b6eca..8dc9eac 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,9 @@ module filippo.io/age go 1.24.0 +// Release build version. +toolchain go1.25.5 + require ( filippo.io/edwards25519 v1.1.0 filippo.io/hpke v0.4.0