generated from cisco-ospo/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.66 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# SPDX-License-Identifier: MPL-2.0
# Terraform Provider release workflow
name: release
# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created
on:
push:
tags:
- "v*"
# Set top-level permissions to read-only
permissions:
contents: read
jobs:
goreleaser:
runs-on: ubuntu-latest
# Releases need permissions to read and write the repository contents
permissions:
contents: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
# Allow goreleaser to access older tag information
fetch-depth: 0
- name: 📦 setup go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"
cache: true
- name: 🔑 import GPG key
id: gpg-key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.TERRAFORM_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TERRAFORM_GPG_PASSPHRASE }}
- name: 🚀 run goreleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.gpg-key.outputs.fingerprint }}