forked from vaxvms/terraform-provider-awx
-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (66 loc) · 2.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This uses an action (crazy-max/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: Release
on:
workflow_dispatch:
push:
branches:
- 'main'
tags-ignore:
- '**'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
- name: Release
id: release
uses: cycjimmy/semantic-release-action@5982a02995853159735cb838992248c4f0f16166 # v2
with:
semantic_version: 17.4.7
branches: |
[
'main'
]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GIT_CREDENTIALS: git:${{ secrets.PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
if: steps.release.outputs.new_release_published == 'true'
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Import GPG key
if: steps.release.outputs.new_release_published == 'true'
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
# These secrets will need to be configured for the repository:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
if: steps.release.outputs.new_release_published == 'true'
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}