-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (84 loc) · 3.15 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
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
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
artifact: fyne-cross/dist/linux-amd64/FairPass.tar.xz
- os: windows
arch: amd64
artifact: fyne-cross/dist/windows-amd64/FairPass.exe.zip
- os: android
arch: multiple
artifact: fyne-cross/dist/android/FairPass.apk
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install fyne-cross compiler
run: go install github.com/fyne-io/fyne-cross@latest
- name: Install fyne
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Set commit hash
run: sed -i "s/Commit = \"none\"/Commit = \"$(git rev-parse --short HEAD)\"/g" internal/utils/version.go
- name: Set tag version
run: sed -i "s/Version = \"v0.0.0\"/Version = \"$(git tag)\"/g" internal/utils/version.go
- name: Build
run: fyne-cross ${{ matrix.os }} -arch ${{ matrix.arch }} -app-id org.fairdatasociety.fairpass -icon icon.png
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.artifact }}
build-mac:
runs-on: macos-11
strategy:
matrix:
include:
- os: darwin
arch: amd64,arm64
artifact: |
fyne-cross/dist/darwin-amd64/FairPass-amd64.dmg
fyne-cross/dist/darwin-arm64/FairPass-arm64.dmg
steps:
- uses: actions/checkout@v2
- name: Install docker
run: brew install docker
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install fyne-cross compiler
run: go install github.com/fyne-io/fyne-cross@latest
- name: Install fyne
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Set commit hash
run: sed -i '' "s/Commit = \"none\"/Commit = \"$(git rev-parse --short HEAD)\"/g" internal/utils/version.go
- name: Set tag version
run: sed -i '' "s/Version = \"v0.0.0\"/Version = \"$(git tag)\"/g" internal/utils/version.go
- name: Build
run: fyne-cross ${{ matrix.os }} -arch ${{ matrix.arch }} -app-id org.fairdatasociety.fairpass -icon icon.png
- name: Make dmg
run: |
hdiutil create tmp.dmg -ov -volname "FairPass" -fs HFS+ -srcfolder fyne-cross/dist/darwin-arm64/FairPass.app
hdiutil convert tmp.dmg -format UDZO -o FairPass-arm64.dmg
mv FairPass-arm64.dmg fyne-cross/dist/darwin-arm64/FairPass-arm64.dmg
rm tmp.dmg
hdiutil create tmp.dmg -ov -volname "FairPass" -fs HFS+ -srcfolder fyne-cross/dist/darwin-amd64/FairPass.app
hdiutil convert tmp.dmg -format UDZO -o FairPass-amd64.dmg
mv FairPass-amd64.dmg fyne-cross/dist/darwin-amd64/FairPass-amd64.dmg
rm tmp.dmg
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.artifact }}