-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (93 loc) · 3.41 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
name: "main"
on:
push:
pull_request:
jobs:
package:
strategy:
fail-fast: false
matrix:
build_target: [ macos-arm64, macos-x86_64, windows-x86_64 ]
go-version: [ 1.18 ]
include:
- build_target: macos-arm64
target: darwin/arm64
os: macos-12
- build_target: macos-x86_64
target: darwin/amd64
os: macos-12
- build_target: windows-x86_64
target: windows/amd64
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Extract git tag
shell: bash
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})"
id: extract_tag
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: setup node
uses: actions/setup-node@v2
with:
node-version: 16
- name: setup wails
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@v2.4.0
- name: Build Wails app
run: |
wails build -platform ${{ matrix.target }} -ldflags "-X main.version=${{ steps.extract_tag.outputs.tag }}"
- name: Import macOS Certificates
if: startsWith(matrix.os, 'macos')
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PWD }}
- name: Signing macOS Application
if: startsWith(matrix.os, 'macos')
run: |
codesign -f -o runtime --timestamp -s Bonaysoft build/bin/Relingo.app
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: relingo-desktop-${{ matrix.build_target }}
path: build/bin/*
- name: Packaging assets
shell: bash
if: startsWith(github.ref, 'refs/tags/')
continue-on-error: true
run: |
cd build/bin/
case ${{ matrix.target }} in
windows/*)
7z -y a relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip relingo-desktop.exe
sha256sum relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip > relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
rm relingo-desktop.exe
;;
*)
npm install --global create-dmg
set -e
create-dmg Relingo.app || true
mv *.dmg relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.dmg
codesign -f -o runtime --timestamp -s Bonaysoft relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.dmg
shasum -a 256 relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.dmg > relingo-desktop-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
;;
esac;
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/bin/*
homebrewBump:
runs-on: macos-12
needs: package
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: saltbo/bump-homebrew-cask-action@main
with:
token: ${{ secrets.PAT }}
tap: saltbo/homebrew-bin
package: relingo