Skip to content

Commit

Permalink
ci: Split out terraform release configuration (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm authored Sep 15, 2024
1 parent f40ac50 commit aa5803c
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 48 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish-awstf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: publish-awstf

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.22.7
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: '~> v1'
args: release --clean -f .goreleaser.tf.yaml
workdir: cloud/aws
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/publish-gcptf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: publish-gcptf

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.22.7
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
args: release --clean -f .goreleaser.tf.yaml
workdir: cloud/gcp
version: '~> v1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions cloud/aws/.goreleaser.tf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
project_name: awstf
release:
prerelease: auto
before:
hooks:
- go work sync
- make predeploybin
builds:
- id: awstf
env:
- CGO_ENABLED=0
binary: aws
main: ./cmd/deploytf
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
archives:
- name_template: >-
{{ .ProjectName }}_
{{- tolower .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ tolower .Arch }}{{ end }}
id: awstf
builds:
- awstf
format_overrides:
- goos: windows
format: zip
checksum:
name_template: "awstf_checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
skip: true
24 changes: 0 additions & 24 deletions cloud/aws/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ builds:
goarch:
- amd64
- arm64
- id: awstf
env:
- CGO_ENABLED=0
binary: aws
main: ./cmd/deploytf
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
archives:
- name_template: >-
{{ .ProjectName }}_
Expand All @@ -43,18 +31,6 @@ archives:
format_overrides:
- goos: windows
format: zip
- name_template: >-
{{ .ProjectName }}tf_
{{- tolower .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ tolower .Arch }}{{ end }}
id: awstf
builds:
- awstf
format_overrides:
- goos: windows
format: zip
checksum:
name_template: "aws_checksums.txt"
snapshot:
Expand Down
40 changes: 40 additions & 0 deletions cloud/gcp/.goreleaser.tf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
project_name: gcptf
release:
prerelease: auto
before:
hooks:
- go work sync
- make predeploybin
builds:
- id: gcptf
env:
- CGO_ENABLED=0
binary: gcp
main: ./cmd/deploytf
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
archives:
- name_template: >-
{{ .ProjectName }}_
{{- tolower .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ tolower .Arch }}{{ end }}
id: gcptf
builds:
- gcptf
format_overrides:
- goos: windows
format: zip
checksum:
name_template: "gcptf_checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
skip: true
24 changes: 0 additions & 24 deletions cloud/gcp/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ builds:
goarch:
- amd64
- arm64
- id: gcptf
env:
- CGO_ENABLED=0
binary: gcp
main: ./cmd/deploytf
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
archives:
- name_template: >-
{{ .ProjectName }}_
Expand All @@ -42,18 +30,6 @@ archives:
format_overrides:
- goos: windows
format: zip
- name_template: >-
{{ .ProjectName }}tf_
{{- tolower .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ tolower .Arch }}{{ end }}
id: gcptf
builds:
- gcptf
format_overrides:
- goos: windows
format: zip
checksum:
name_template: "gcp_checksums.txt"
snapshot:
Expand Down

0 comments on commit aa5803c

Please sign in to comment.