Skip to content

Commit 998bd9b

Browse files
committed
Update google-auth and fix release pipeline.
1 parent 4e66b34 commit 998bd9b

3 files changed

Lines changed: 75 additions & 26 deletions

File tree

.github/workflows/master.yaml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pipeline
1+
name: Latest Stable Pipeline
22

33
on:
44
push:
@@ -13,26 +13,40 @@ env:
1313
jobs:
1414
debian_ubuntu:
1515
name: Build Debian and Ubuntu based OS images
16+
runs-on: self-hosted
17+
1618
strategy:
1719
matrix:
1820
os: [debian, ubuntu]
19-
runs-on: self-hosted
21+
2022
steps:
2123
- name: Checkout
2224
uses: actions/checkout@v3
25+
26+
- uses: google-github-actions/auth@v1
27+
with:
28+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
29+
30+
- name: Set up Cloud SDK
31+
uses: google-github-actions/setup-gcloud@v0
32+
2333
- name: Set up Go 1.20
2434
uses: actions/setup-go@v3
2535
with:
2636
go-version: '1.20.x'
37+
2738
- name: Lint
2839
uses: golangci/golangci-lint-action@v3
2940
with:
3041
args: --build-tags integration -p bugs -p unused --timeout=3m
42+
3143
- name: build install
3244
run: make
45+
3346
- name: Prepare build environment
3447
shell: bash
3548
run: ./prepare.sh ${{ matrix.os }}
49+
3650
- name: Build docker image for workers and export tarball
3751
run: |
3852
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -45,6 +59,7 @@ jobs:
4559
--summary \
4660
--no-lint \
4761
--no-push
62+
4863
- name: Build docker image for firewalls and export tarball
4964
run: |
5065
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -59,28 +74,37 @@ jobs:
5974
--no-lint \
6075
--no-push
6176
if: ${{ matrix.os == 'ubuntu' }}
62-
- uses: google-github-actions/setup-gcloud@v0
63-
with:
64-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
65-
service_account_key: ${{ secrets.GCP_SA_KEY }}
77+
6678
- name: Upload image tarballs to GCS
6779
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os
6880

6981
centos:
7082
name: Build Centos based OS image
7183
runs-on: self-hosted
84+
7285
steps:
7386
- name: Checkout
7487
uses: actions/checkout@v3
88+
89+
- uses: google-github-actions/auth@v1
90+
with:
91+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
92+
93+
- name: Set up Cloud SDK
94+
uses: google-github-actions/setup-gcloud@v0
95+
7596
- name: Set up Go 1.20
7697
uses: actions/setup-go@v3
7798
with:
7899
go-version: '1.20.x'
100+
79101
- name: build install
80102
run: make
103+
81104
- name: Prepare build environment
82105
shell: bash
83106
run: ./prepare.sh centos
107+
84108
- name: Build docker image for centos based workers and export tarball
85109
run: |
86110
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -93,9 +117,6 @@ jobs:
93117
--summary \
94118
--no-lint \
95119
--no-push
96-
- uses: google-github-actions/setup-gcloud@v0
97-
with:
98-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
99-
service_account_key: ${{ secrets.GCP_SA_KEY }}
120+
100121
- name: Upload image tarballs to GCS
101122
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os

.github/workflows/pr.yaml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pipeline
1+
name: Pull Request Pipeline
22

33
on:
44
pull_request:
@@ -12,26 +12,41 @@ env:
1212
jobs:
1313
debian-ubuntu:
1414
name: Build Debian and Ubuntu based OS images
15+
1516
strategy:
1617
matrix:
1718
os: [debian, ubuntu]
19+
1820
runs-on: self-hosted
21+
1922
steps:
2023
- name: Checkout
2124
uses: actions/checkout@v3
25+
26+
- uses: google-github-actions/auth@v1
27+
with:
28+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
29+
30+
- name: Set up Cloud SDK
31+
uses: google-github-actions/setup-gcloud@v0
32+
2233
- name: Set up Go 1.20
2334
uses: actions/setup-go@v3
2435
with:
2536
go-version: '1.20.x'
37+
2638
- name: Lint
2739
uses: golangci/golangci-lint-action@v3
2840
with:
2941
args: --build-tags integration -p bugs -p unused --timeout=3m
42+
3043
- name: build install
3144
run: make
45+
3246
- name: Prepare build environment
3347
shell: bash
3448
run: ./prepare.sh ${{ matrix.os }}
49+
3550
- name: Build docker image for workers and export tarball
3651
run: |
3752
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -44,6 +59,7 @@ jobs:
4459
--summary \
4560
--no-lint \
4661
--no-push
62+
4763
- name: Build docker image for firewalls and export tarball
4864
run: |
4965
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -57,27 +73,37 @@ jobs:
5773
--summary \
5874
--no-lint \
5975
--no-push
60-
- uses: google-github-actions/setup-gcloud@v0
61-
with:
62-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
63-
service_account_key: ${{ secrets.GCP_SA_KEY }}
76+
6477
- name: Upload image tarballs to GCS
6578
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os/pull_requests/
79+
6680
centos:
6781
name: Build Centos based OS image
6882
runs-on: self-hosted
83+
6984
steps:
7085
- name: Checkout
7186
uses: actions/checkout@v3
87+
88+
- uses: google-github-actions/auth@v1
89+
with:
90+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
91+
92+
- name: Set up Cloud SDK
93+
uses: google-github-actions/setup-gcloud@v0
94+
7295
- name: Set up Go 1.20
7396
uses: actions/setup-go@v3
7497
with:
7598
go-version: '1.20.x'
99+
76100
- name: build install
77101
run: make
102+
78103
- name: Prepare build environment
79104
shell: bash
80105
run: ./prepare.sh centos
106+
81107
- name: Build docker image for centos based workers and export tarball
82108
run: |
83109
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
@@ -91,9 +117,6 @@ jobs:
91117
--summary \
92118
--no-lint \
93119
--no-push
94-
- uses: google-github-actions/setup-gcloud@v0
95-
with:
96-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
97-
service_account_key: ${{ secrets.GCP_SA_KEY }}
120+
98121
- name: Upload image tarballs to GCS
99122
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os/pull_requests/

.github/workflows/release.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Pipeline
1+
---
2+
name: Release Pipeline
23

34
on:
45
release:
@@ -11,11 +12,15 @@ env:
1112
jobs:
1213
copy:
1314
name: Copy image tarballs from latest stable to release
15+
runs-on: ubuntu-latest
16+
1417
steps:
15-
- uses: google-github-actions/setup-gcloud@v0
16-
with:
17-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
18-
service_account_key: ${{ secrets.GCP_SA_KEY }}
18+
- uses: google-github-actions/auth@v1
19+
with:
20+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
21+
22+
- name: Set up Cloud SDK
23+
uses: google-github-actions/setup-gcloud@v0
1924

20-
- run: |
21-
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/ gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}
25+
- run: |
26+
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/ gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}

0 commit comments

Comments
 (0)