Skip to content

Commit

Permalink
Prepare for publishing to Terraform Registry
Browse files Browse the repository at this point in the history
Update GitHub actions build
Only run release pipeline if tags are pushed
Draft releases only, Signature for Terraform regisitry has to be added manually
  • Loading branch information
timohirt committed Aug 17, 2020
1 parent 70e5a12 commit e9c64fc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/lint-test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ jobs:
name: Lint-Test-Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14

- name: Check out code
uses: actions/checkout@v1

- name: Run linter
-
name: Check out code
uses: actions/checkout@v2
-
name: Run linter
run: make lint

- name: Run acceptance tests
-
name: Run acceptance tests
run: make testacc
env:
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }}

- name: Build
-
name: Build
run: make build


Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Release
on:
create:
push:
tags:
- v*

Expand All @@ -9,12 +9,19 @@ jobs:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Create release on GitHub
uses: docker://goreleaser/goreleaser:latest
-
name: Check out code
uses: actions/checkout@v2
-
name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Create release on GitHub
uses: goreleaser/goreleaser-action@v2
with:
args: release
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9 changes: 8 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ builds:
ignore:
- goos: darwin
goarch: 386
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: 'checksums.txt'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
snapshot:
name_template: "{{ .Tag }}-PREVIEW"
changelog:
Expand All @@ -18,3 +23,5 @@ changelog:
exclude:
- '^docs:'
- '^test:'
release:
draft: true

0 comments on commit e9c64fc

Please sign in to comment.