-
-
Notifications
You must be signed in to change notification settings - Fork 23
73 lines (61 loc) · 1.94 KB
/
darwin.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
name: Upload macOS binaries
env:
dev_tag: nightly
on:
repository_dispatch:
types: [release-focus]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go v1.21
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Write release version
run: |
VERSION=${{ github.event.client_payload.ref }}
echo Version: ${VERSION#v}
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
- name: Build assets with Goreleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean --snapshot --config=.goreleaser_darwin.yml
- name: Temporarily save build assets
uses: actions/upload-artifact@v3
with:
name: darwin-artifacts
path: dist
retention-days: 1
upload:
runs-on: macos-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve saved build assets
uses: actions/download-artifact@v3
with:
name: darwin-artifacts
path: dist
- name: Upload assets to latest release
if: github.event_name == 'repository_dispatch'
run: |
if [ ${{ github.event.client_payload.ref_type }} == 'branch' ]; then
gh release upload ${{ env.dev_tag }} dist/*.tar.gz dist/darwin-checksums.txt --clobber
else
gh release upload ${{ github.event.client_payload.ref }} dist/*.tar.gz dist/darwin-checksums.txt --clobber
fi
echo "${{ github.event.client_payload.ref }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger NPM Publish
uses: peter-evans/repository-dispatch@v2
if: github.event.client_payload.ref_type == 'tag'
with:
event-type: release-focus-npm