-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.44 KB
/
main.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
macos-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-13, macos-14 ]
steps:
- name: Determine architecture
id: architecture
run: echo "arch=$(uname -m)" >> "${GITHUB_ENV}"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: go build -o ipingtray
- run: go install github.com/machinebox/appify@latest
- name: Create macOS app
run: appify -name "IPingTray" -icon docs/icon.png ipingtray
- name: Prepare DMG
run: mkdir dmg && mv IPingTray.app dmg/ && ln -s /Applications dmg/Applications
- name: Install create-dmg
run: brew install create-dmg
- name: Create DMG
run: create-dmg IPingTray.dmg dmg
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: ipingtray-${{ env.arch }}.dmg
path: IPingTray.dmg
release:
permissions:
contents: write
issues: write
pull-requests: write
needs:
- macos-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v4
with:
path: dist
- run: find .
- uses: actions/setup-node@v4
with:
node-version: latest
- name: "configure semantic-release"
run: |
npm install @semantic-release/github -D
cat <<EOF > .releaserc.yml
branches:
- 'main'
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator':
- "@semantic-release/github":
assets:
- path: dist/*
- '@semantic-release/github'
- '@semantic-release/changelog'
- "@semantic-release/git":
message: "chore(release): v\${nextRelease.version}\n\n\${nextRelease.notes}"
publish:
- '@semantic-release/github'
verifyConditions:
- '@semantic-release/github'
success: false
fail: false
npmPublish: false
EOF
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}