-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (53 loc) · 1.71 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
name: goreleaser
on:
pull_request:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: macos-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Gon using homebrew
run: brew install Bearer/tap/gon
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
# The password used to import the PKCS12 file.
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- name: Go Init
uses: ./.github/actions/go_init
- run: go run main.go --version
- name: Run GoReleaser (publish)
uses: goreleaser/goreleaser-action@v5
if: ${{ github.event_name != 'pull_request' }}
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser (dry run)
uses: goreleaser/goreleaser-action@v5
if: ${{ github.event_name == 'pull_request' }}
with:
version: latest
args: release --clean --snapshot --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AC_PASSWORD: ${{ secrets.APPLE_AC_PASSWORD }}
- name: Upload assets
uses: actions/upload-artifact@v4
# only upload artifacts on pull requests
if: ${{ github.event_name == 'pull_request' }}
with:
name: test-release
path: dist/*