Skip to content

Commit a4fa105

Browse files
committed
chore: update Go version to 1.25 in workflows and go.mod & adds nightly cache update
1 parent 6d49f69 commit a4fa105

3 files changed

Lines changed: 34 additions & 42 deletions

File tree

.github/workflows/release_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
with:
1717
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/
1818

19-
- name: Set up Go 1.22
19+
- name: Set up Go 1.25
2020
uses: actions/setup-go@v2
2121
with:
22-
go-version: 1.22
22+
go-version: 1.25
2323
id: go
2424

2525
- name: Run GoReleaser

.github/workflows/update_cache.yml

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,44 @@
1-
name: Update cache
1+
name: Nightly cache refresh
22

33
on:
4-
push:
5-
branches:
6-
- foo
7-
# - develop
8-
# schedule:
9-
# - cron: '15 0 * * *'
4+
schedule:
5+
- cron: '0 1 * * *'
6+
workflow_dispatch:
107

118
jobs:
12-
resources:
13-
name: Update cache
9+
refresh-cache:
1410
runs-on: ubuntu-latest
15-
steps:
16-
- name: Check out code into the Go module directory
17-
uses: actions/checkout@v2
18-
19-
- name: Set up NodeJS
20-
uses: actions/setup-node@v1
11+
permissions:
12+
contents: write
2113

22-
- name: Set up Go 1.22
23-
uses: actions/setup-go@v2
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
2417
with:
25-
go-version: 1.22
26-
id: go
18+
fetch-depth: 0
2719

28-
- name: Build binary
29-
run: make all
30-
31-
- name: Create cache
32-
run: export GITHUB_TOKEN=${{ secrets.GO_RELEASER_GITHUB_TOKEN }} && ./bin/binenv update -f -v -c2
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.25'
3324

34-
- name: Format caches
35-
run: jq '.' distributions/cache.json > dist.json && jq '.' ~/.cache/binenv/cache.json > new.json
25+
- name: Build cache
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: scripts/buildcache.sh
3629

37-
- name: Compare caches
38-
id: compare
30+
- name: Commit cache artifacts
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3933
run: |
40-
echo "DIFF=$(diff dist.json new.json > /dev/null 2>&1; echo $?)" >> $GITHUB_ENV
34+
if git diff --quiet -- distributions/cache.json; then
35+
echo "Cache already up to date"
36+
exit 0
37+
fi
4138
42-
- name: Copy cache
43-
run: cat ~/.cache/binenv/cache.json | jq . > distributions/cache.json
44-
if: ${{ env.DIFF != 0 }}
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
4541
46-
- name: Update cache
47-
uses: test-room-7/action-update-file@v1
48-
if: ${{ env.DIFF != 0 }}
49-
with:
50-
file-path: distributions/cache.json
51-
commit-msg: automatic cache update
52-
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
git add distributions/cache.json
43+
git commit -m "chore: nightly cache refresh"
44+
git push

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/devops-works/binenv
22

3-
go 1.22
3+
go 1.25
44

55
require (
66
github.com/hashicorp/go-version v1.2.1

0 commit comments

Comments
 (0)