-
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (55 loc) · 1.81 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
name: release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release'
required: true
version:
description: 'Release version'
required: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
deployments: write
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4
with:
ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }}
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
- name: Place a Git tag and push it
run: |
git config user.name "microcks-bot"
git config user.email "[email protected]"
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GORELEASER_GPG_SECRET_KEY }}
passphrase: ${{ secrets.GORELEASER_GPG_PASSPHRASE }}
- name: Install Syft for GoReleaser
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Publish release with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import-gpg.outputs.fingerprint }}