Skip to content

Commit 76b4d2e

Browse files
authored
update action/cache version (#492)
1 parent f27971f commit 76b4d2e

File tree

3 files changed

+65
-65
lines changed

3 files changed

+65
-65
lines changed

.github/workflows/build.yaml

+20-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- uses: actions/cache@v2
13+
- uses: actions/cache@v4
1414
with:
1515
path: |
1616
~/.cache/go-build
@@ -21,7 +21,7 @@ jobs:
2121
${{ runner.os }}-go-
2222
- uses: actions/setup-go@v2
2323
with:
24-
go-version: '1.17.1'
24+
go-version: "1.17.1"
2525
- name: Build & Test
2626
run: |
2727
echo "/usr/local/kubebuilder/bin" >> $GITHUB_PATH
@@ -34,20 +34,21 @@ jobs:
3434
arch: ["amd64"]
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v2
38-
- uses: actions/cache@v2
39-
with:
40-
path: |
41-
~/.cache/go-build
42-
~/go/pkg/mod
43-
~/go/bin/
44-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
45-
restore-keys: |
46-
${{ runner.os }}-go-
47-
- uses: actions/setup-go@v2
48-
with:
49-
go-version: '1.17.1'
50-
- name: Build the KIT CLI
51-
run: |
52-
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
53-
working-directory: substrate
37+
- uses: actions/checkout@v2
38+
- uses: actions/cache@v4
39+
with:
40+
path: |
41+
~/.cache/go-build
42+
~/go/pkg/mod
43+
~/go/bin/
44+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
45+
restore-keys: |
46+
${{ runner.os }}-go-
47+
- uses: actions/setup-go@v2
48+
with:
49+
go-version: "1.17.1"
50+
- name: Build the KIT CLI
51+
run: |
52+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
53+
working-directory: substrate
54+

.github/workflows/image.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Build the operator image and push to public ECR on the main branch
32
on:
43
push:
@@ -9,7 +8,7 @@ jobs:
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v2
12-
- uses: actions/cache@v2
11+
- uses: actions/cache@v4
1312
with:
1413
path: |
1514
~/.cache/go-build
@@ -20,7 +19,7 @@ jobs:
2019
${{ runner.os }}-go-
2120
- uses: actions/setup-go@v2
2221
with:
23-
go-version: '1.17.1'
22+
go-version: "1.17.1"
2423
- name: Build & Test
2524
run: |
2625
echo "/usr/local/kubebuilder/bin" >> $GITHUB_PATH

.github/workflows/release.yaml

+43-43
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release operator version, generates a new Docker image and helm charts
22
on:
33
push:
4-
tags: ['v*']
4+
tags: ["v*"]
55
workflow_dispatch: {}
66
jobs:
77
release:
@@ -10,8 +10,8 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- uses: actions/setup-go@v3
1212
with:
13-
go-version: '1.17.1'
14-
- uses: actions/cache@v2
13+
go-version: "1.17.1"
14+
- uses: actions/cache@v4
1515
with:
1616
path: |
1717
~/.cache/go-build
@@ -55,43 +55,43 @@ jobs:
5555
arch: ["amd64"]
5656
runs-on: ubuntu-latest
5757
steps:
58-
- uses: actions/checkout@v2
59-
- uses: actions/cache@v2
60-
with:
61-
path: |
62-
~/.cache/go-build
63-
~/go/pkg/mod
64-
~/go/bin/
65-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
66-
restore-keys: |
67-
${{ runner.os }}-go-
68-
- name: Set env
69-
run: |
70-
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
71-
- uses: actions/setup-go@v3
72-
with:
73-
go-version: '1.17.1'
74-
- name: Build the KIT CLI
75-
run: |
76-
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
77-
zip ./bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip -j ./bin/kitctl
78-
working-directory: substrate
79-
- name: Attach the binary to release
80-
uses: softprops/action-gh-release@v1
81-
with:
82-
files: "./substrate/bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip"
83-
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85-
- name: Update brew formulae
86-
uses: mislav/bump-homebrew-formula-action@v1
87-
with:
88-
formula-name: kitctl
89-
formula-path: kitctl.rb
90-
homebrew-tap: awslabs/kubernetes-iteration-toolkit
91-
base-branch: main
92-
download-url: https://github.com/awslabs/kubernetes-iteration-toolkit/releases/download/${{ env.RELEASE_VERSION }}/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip
93-
commit-message: |
94-
Update kitctl to ${{ env.RELEASE_VERSION }}
95-
Created by Github actions during Release CLI action
96-
env:
97-
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
58+
- uses: actions/checkout@v2
59+
- uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cache/go-build
63+
~/go/pkg/mod
64+
~/go/bin/
65+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
66+
restore-keys: |
67+
${{ runner.os }}-go-
68+
- name: Set env
69+
run: |
70+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
71+
- uses: actions/setup-go@v3
72+
with:
73+
go-version: "1.17.1"
74+
- name: Build the KIT CLI
75+
run: |
76+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
77+
zip ./bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip -j ./bin/kitctl
78+
working-directory: substrate
79+
- name: Attach the binary to release
80+
uses: softprops/action-gh-release@v1
81+
with:
82+
files: "./substrate/bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip"
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
- name: Update brew formulae
86+
uses: mislav/bump-homebrew-formula-action@v1
87+
with:
88+
formula-name: kitctl
89+
formula-path: kitctl.rb
90+
homebrew-tap: awslabs/kubernetes-iteration-toolkit
91+
base-branch: main
92+
download-url: https://github.com/awslabs/kubernetes-iteration-toolkit/releases/download/${{ env.RELEASE_VERSION }}/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip
93+
commit-message: |
94+
Update kitctl to ${{ env.RELEASE_VERSION }}
95+
Created by Github actions during Release CLI action
96+
env:
97+
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)