Skip to content

Commit 25ecf45

Browse files
hcsa73Henrique Santos
andauthored
Implement release pipeline (#9)
* Implement release pipeline * Add main trigger, fix major versions --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
1 parent d5274a8 commit 25ecf45

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Terraform Provider release workflow.
2+
name: Release
3+
4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
branches:
11+
- main
12+
13+
# Releases need permissions to read and write the repository contents.
14+
# GitHub considers creating releases and uploading assets as writing contents.
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
goreleaser:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
# Allow goreleaser to access older tag information.
25+
fetch-depth: 0
26+
- uses: actions/setup-go@v4
27+
with:
28+
go-version-file: 'go.mod'
29+
cache: true
30+
- name: Import GPG key
31+
uses: crazy-max/ghaction-import-gpg@v5
32+
id: import_gpg
33+
with:
34+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
35+
- name: Run GoReleaser
36+
uses: goreleaser/goreleaser-action@v4
37+
with:
38+
args: release --clean
39+
env:
40+
# GitHub sets the GITHUB_TOKEN secret automatically.
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

terraform-registry-manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": 1,
3+
"metadata": {
4+
"protocol_versions": [
5+
"6.0"
6+
]
7+
}
8+
}

0 commit comments

Comments
 (0)