Skip to content

Commit

Permalink
Prepare for Go 1.22 release (#65)
Browse files Browse the repository at this point in the history
* feat: add script for updating gha

* chore: update gha

* docs: update CHANGELOG

* feat: prepare go upate for Go 1.22

* fix: set up go for go-check

* fix: use proper repo name when copying templates

* fix: do not change git defaults when copying templates

* chore: release v0.0.17
  • Loading branch information
galargh authored Mar 13, 2024
1 parent 8050f4e commit a9e8126
Show file tree
Hide file tree
Showing 20 changed files with 138 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-label-by-query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
QUERY: ${{ github.event.inputs.query }}
LABEL: ${{ github.event.inputs.label }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
result-encoding: string
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-3rd-party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
outputs:
targets: ${{ steps.set-matrix.outputs.targets }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: set-matrix
run: |
TARGETS=$(find . -type f -name "*.yml" | sed "s|^\./||" | grep -v workflow-templates/header.yml | jq -R -s -c 'split("\n")[:-1]')
Expand All @@ -23,7 +23,7 @@ jobs:
file: ${{ fromJSON(needs.matrix.outputs.targets) }}
name: ${{ matrix.file }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/render-templates
- name: Run check
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
check-yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/render-templates
- uses: pl-strflt/validate-yaml-schema@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
BRANCH: ${{ github.event.inputs.branch }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.UCI_GITHUB_TOKEN }}
retries: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
BRANCH: ${{ github.event.inputs.branch }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.UCI_GITHUB_TOKEN }}
retries: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
batches: ${{ steps.matrix.outputs.result }}
steps:
- id: matrix
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
FILTER: ${{ inputs.filter }}
with:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ jobs:
runs-on: ubuntu-latest
name: All
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: stable
- id: config
uses: pl-strflt/uci/.github/actions/read-config@main
- id: go-mod
uses: pl-strflt/uci/.github/actions/read-go-mod@main
- id: go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version || (fromJSON(steps.go-mod.outputs.json).Go && format('{0}.x', fromJSON(steps.go-mod.outputs.json).Go)) }}
cache: false
Expand All @@ -33,7 +36,8 @@ jobs:
env:
STATICCHECK_VERSIONS: |
{
"1.21": "9e12e6014d3b0a854950490051ad1338fc6badd1",
"1.22": "a093f7c2d3d45d5104fb3414ae939a98be37be02",
"1.21": "f57fec247eddf41c04774af84b91e41dd78a3173",
"1.20": "9e12e6014d3b0a854950490051ad1338fc6badd1",
"1.19": "376210a89477dedbe6fdc4484b233998650d7b3c",
"1.18": "376210a89477dedbe6fdc4484b233998650d7b3c",
Expand All @@ -50,7 +54,7 @@ jobs:
echo "Installing staticcheck@$version"
go install honnef.co/go/tools/cmd/staticcheck@$version || go get honnef.co/go/tools/cmd/staticcheck@$version
- name: Check that go.mod is tidy
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
with:
run: |
go mod tidy
Expand All @@ -69,18 +73,18 @@ jobs:
fi
- name: go vet
if: success() || failure() # run this step even if the previous one failed
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
with:
run: go vet ./...
- name: staticcheck
if: success() || failure() # run this step even if the previous one failed
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
with:
run: |
set -o pipefail
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
- name: go generate
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
if: (success() || failure()) && fromJSON(steps.config.outputs.json).gogenerate == true
env:
IGNORE_PROTOC_VERSION_COMMENTS: ${{ inputs.go-generate-ignore-protoc-version-comments }}
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ jobs:
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
# Update to v4 is blocked by https://github.com/actions/setup-go/pull/411
# - uses: actions/setup-go@v4
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: stable
# cache: false
Expand Down Expand Up @@ -73,9 +71,7 @@ jobs:
echo "GOTESTFLAGS=-v $GOTESTFLAGS" >> $GITHUB_ENV
echo "GO386FLAGS=-v $GO386FLAGS" >> $GITHUB_ENV
echo "GORACEFLAGS=-v $GORACEFLAGS" >> $GITHUB_ENV
# Update to v4 is blocked by https://github.com/actions/setup-go/pull/411
# - uses: actions/setup-go@v4
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ steps.go.outputs.version }}
- name: Go information
Expand All @@ -87,7 +83,7 @@ jobs:
if: hashFiles('./.github/actions/go-test-setup') != ''
- name: Run tests
if: contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
env:
GOFLAGS: ${{ format('{0} {1}', env.GOTESTFLAGS, env.GOFLAGS) }}
with:
Expand All @@ -97,7 +93,7 @@ jobs:
if: matrix.os != 'macos' &&
fromJSON(steps.config.outputs.json).skip32bit != true &&
contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
env:
GOARCH: 386
GOFLAGS: ${{ format('{0} {1}', env.GO386FLAGS, env.GOFLAGS) }}
Expand All @@ -110,7 +106,7 @@ jobs:
if: matrix.os == 'ubuntu' &&
fromJSON(steps.config.outputs.json).skipRace != true &&
contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
uses: protocol/multiple-go-modules@v1.4
env:
GOFLAGS: ${{ format('{0} {1}', env.GORACEFLAGS, env.GOFLAGS) }}
with:
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -43,8 +43,8 @@ jobs:
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -58,8 +58,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -73,8 +73,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -88,8 +88,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -103,8 +103,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -123,8 +123,8 @@ jobs:
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -144,8 +144,8 @@ jobs:
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -160,8 +160,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -175,8 +175,8 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand All @@ -198,7 +198,7 @@ jobs:
env:
BRANCHES: ${{ inputs.branches }}
REF: ${{ github.ref }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const branches = JSON.parse(process.env.BRANCHES);
Expand All @@ -216,10 +216,10 @@ jobs:
runs-on: ubuntu-latest
if: needs.release-check.outputs.release == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
QUERY: is:pr author:web3-bot state:open archived:false
BRANCH: ${{ github.event.inputs.branch }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.UCI_GITHUB_TOKEN }}
retries: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: |
pip install yq
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ matrix.repository }}
repository: ${{ matrix.repository }}
Expand All @@ -72,7 +72,7 @@ jobs:
submodules: recursive
fetch-depth: 0
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ github.repository }}
ref: ${{ github.ref }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Retrieve PR information
env:
PULL_REQUEST: ${{ toJSON(github.event.pull_request) }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
let pr = JSON.parse(process.env.PULL_REQUEST);
Expand All @@ -38,10 +38,10 @@ jobs:
pr = open[0];
}
core.setOutput('json', JSON.stringify(pr));
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: go-mod
uses: pl-strflt/uci/.github/actions/read-go-mod@main
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}.x
- id: version
Expand All @@ -62,7 +62,7 @@ jobs:
env:
BRANCHES: ${{ inputs.branches }}
BASE_REF: ${{ fromJSON(steps.pr.outputs.json).base.ref }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const branches = JSON.parse(process.env.BRANCHES);
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
fi
echo "$EOF" >> $GITHUB_OUTPUT
- name: Post message on PR
uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # v2.6.2
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: steps.tag.outputs.exists == 'false'
with:
header: release-check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: release
uses: pl-strflt/changelog-driven-release@v1
with:
path: CHANGELOG.md
draft: ${{ github.event_name == 'pull_request' }}
- if: github.event_name == 'pull_request' && steps.release.outputs.tag != ''
uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # v2.6.2
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
with:
header: release
recreate: true
Expand Down
Loading

0 comments on commit a9e8126

Please sign in to comment.