Skip to content

Commit cf6fe66

Browse files
Copilotziflex
andauthored
Add Google Artifact Registry to publish workflow (#53)
* Initial plan * Add Google Cloud Registry support to publish workflow Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> * Use Google Artifact Registry instead of GCR Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> * Add id-token write permission for GCP authentication Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> * Use Workload Identity Federation for GCP authentication Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> * Use secrets with GCP_ prefix for workload identity configuration Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com>
1 parent 8870e72 commit cf6fe66

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: write
1010
packages: write
11+
id-token: write
1112

1213
jobs:
1314
goreleaser:
@@ -36,10 +37,23 @@ jobs:
3637
registry: ghcr.io
3738
username: ${{ github.actor }}
3839
password: ${{ secrets.GITHUB_TOKEN }}
40+
- id: 'auth'
41+
name: 'Authenticate to Google Cloud'
42+
uses: 'google-github-actions/auth@v1'
43+
with:
44+
create_credentials_file: true
45+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
46+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
47+
- name: Login to Google Artifact Registry
48+
uses: docker/login-action@v3
49+
with:
50+
registry: us-east1-docker.pkg.dev
51+
username: oauth2accesstoken
52+
password: ${{ steps.auth.outputs.access_token }}
3953
- name: Run GoReleaser
4054
uses: goreleaser/goreleaser-action@v6
4155
with:
4256
version: latest
4357
args: release --clean
4458
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ dockers:
5050
- "ghcr.io/montferret/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
5151
- "ghcr.io/montferret/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}"
5252
- "ghcr.io/montferret/{{ .ProjectName }}:latest"
53+
- "us-east1-docker.pkg.dev/montferret/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
54+
- "us-east1-docker.pkg.dev/montferret/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}"
55+
- "us-east1-docker.pkg.dev/montferret/{{ .ProjectName }}:latest"
5356
build_flag_templates:
5457
- "--pull"
5558
- "--label=org.opencontainers.image.created={{.Date}}"
@@ -69,4 +72,4 @@ changelog:
6972
filters:
7073
exclude:
7174
- '^docs:'
72-
- '^test:'
75+
- '^test:'

0 commit comments

Comments
 (0)