Skip to content

Commit a0ae0fa

Browse files
committed
fix: use specific goreleaser config and push to 3 prod regions
1 parent 9724f8e commit a0ae0fa

File tree

5 files changed

+51
-11
lines changed

5 files changed

+51
-11
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ jobs:
3333
uses: goreleaser/goreleaser-action@v6
3434
with:
3535
distribution: goreleaser
36-
version: latest
37-
args: release --clean
36+
version: v2.10.2
37+
args: release -f .goreleaser-staging.yml --clean
3838
env:
3939
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_STAGING_ACCESS_KEY }}
4040
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_STAGING_SECRET_KEY }}
41-
SCW_BUCKET_NAME: ${{ vars.SCW_STAGING_BUCKET_NAME }}
42-
RELEASE_DISABLE: true
4341

4442
- name: Upload artifacts
4543
uses: actions/upload-artifact@v4

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: goreleaser/goreleaser-action@v6
2929
with:
3030
distribution: goreleaser
31-
version: latest
31+
version: v2.10.2
3232
args: release --snapshot --clean
3333
env:
3434
RELEASE_DISABLE: true

.github/workflows/tag.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
uses: goreleaser/goreleaser-action@v6
2525
with:
2626
distribution: goreleaser
27-
version: latest
28-
args: release --clean
27+
version: v2.10.2
28+
args: release -f .goreleaser-prod.yml --clean
2929
env:
3030
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_PROD_ACCESS_KEY }}
3131
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_PROD_SECRET_KEY }}
32-
SCW_BUCKET_NAME: ${{ vars.SCW_PROD_BUCKET_NAME }}
3332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
RELEASE_DISABLE: false

.goreleaser-prod.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
builds:
7+
- ldflags:
8+
- "-s -w -extldflags '-static' -X main.Version={{ .Version }}"
9+
targets:
10+
- linux_amd64
11+
- linux_arm64
12+
env:
13+
- CGO_ENABLED=0
14+
flags:
15+
- -trimpath
16+
binary: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
17+
archives:
18+
- formats: ['binary']
19+
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
20+
checksum:
21+
name_template: 'checksums.txt'
22+
release:
23+
disable: false
24+
blobs:
25+
- provider: s3
26+
endpoint: "https://s3.fr-par.scw.cloud"
27+
bucket: "scw-fr-par-k8s-agent"
28+
directory: "agent/{{ .Version }}"
29+
region: "fr-par"
30+
acl: "public-read"
31+
- provider: s3
32+
endpoint: "https://s3.nl-ams.scw.cloud"
33+
bucket: "scw-nl-ams-k8s-agent"
34+
directory: "agent/{{ .Version }}"
35+
region: "nl-ams"
36+
acl: "public-read"
37+
- provider: s3
38+
endpoint: "https://s3.pl-waw.scw.cloud"
39+
bucket: "scw-pl-waw-k8s-agent"
40+
directory: "agent/{{ .Version }}"
41+
region: "pl-waw"
42+
acl: "public-read"

.goreleaser.yml renamed to .goreleaser-staging.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ archives:
2020
checksum:
2121
name_template: 'checksums.txt'
2222
release:
23-
disable: "{{ .Env.RELEASE_DISABLE }}"
23+
disable: true
2424
blobs:
2525
- provider: s3
2626
endpoint: "https://s3.fr-par.scw.cloud"
27-
bucket: "{{ .Env.SCW_BUCKET_NAME }}"
27+
bucket: "scw-staging-k8s-agent"
28+
region: "fr-par"
2829
directory: "agent/{{ .Version }}"
30+
acl: "public-read"

0 commit comments

Comments
 (0)