-
Notifications
You must be signed in to change notification settings - Fork 31
60 lines (50 loc) · 1.89 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
# Releases are triggered on tags that start with "v".
on:
push:
tags:
- 'v*'
jobs:
goreleaser:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v4
with: { go-version: 1.19 }
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser to create draft release
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install spacectl
uses: spacelift-io/setup-spacectl@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release to Spacelift registry (preprod)
run: spacectl provider create-version --type=spacelift
env:
GPG_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
SPACELIFT_API_KEY_ENDPOINT: https://spacelift-io.app.spacelift.dev
SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_PREPROD_API_KEY_ID }}
SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_PREPROD_API_KEY_SECRET }}
- name: Release to Spacelift registry (prod)
run: spacectl provider create-version --type=spacelift
env:
GPG_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
SPACELIFT_API_KEY_ENDPOINT: https://spacelift-io.app.spacelift.io
SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_PROD_API_KEY_ID }}
SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_PROD_API_KEY_SECRET }}