This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
132 lines (128 loc) · 4.85 KB
/
build.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
on:
push:
tags:
- "v*"
jobs:
package:
strategy:
matrix:
go-version: [1.17]
os: [macos-11, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set Version
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# - name: Get Wails dependencies
# run: sudo apt update && sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev
# if: matrix.os == 'ubuntu-latest'
- name: Get Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- 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 }}
if: matrix.os == 'macos-11'
- name: Install gon via HomeBrew for code signing and app notarization
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
if: matrix.os == 'macos-11'
- name: Build and Sign MacOS Binaries
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
run: |
./scripts/build-macos.sh
if: matrix.os == 'macos-11'
# - name: Build package linux
# run: |
# export PATH=$PATH:$(go env GOPATH)/bin
# echo "building on ${{ matrix.os }}"
# echo ${{ env.GITHUB_REF }}
# echo ${{ env.GITHUB_HEAD_REF }}
# mkdir -p ~/.wails
# cp wails.json ~/.wails/
# export LOG_LEVEL=debug
# export GODEBUG=1
# wails build
# tar -czvf riftshare.tar.gz ./build/riftshare
# # wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
# # chmod +x linuxdeploy*.AppImage
# # ls ./
# # ./linuxdeploy*.AppImage --appdir AppDir --executable ./build/riftshare --desktop-file=riftshare.AppImage.desktop --icon-file=appicon--512.png --output appimage
# if: matrix.os == 'ubuntu-latest'
- name: Build package windows
run: |
$GP = (go env GOPATH)
$env:path = "$env:path;$GP\bin"
echo "building on ${{ matrix.os }}"
choco install mingw
wails build -platform windows/amd64 -clean
Compress-Archive -Path .\build\bin\RiftShare.exe -DestinationPath .\RiftShare-windows-amd64.zip
if: matrix.os == 'windows-latest'
- name: upload artifacts macOS-AMD64
uses: actions/upload-artifact@v2
with:
name: riftshare-macOS
path: RiftShare-*.zip
if: matrix.os == 'macos-11'
# - name: upload artifact linux
# uses: actions/upload-artifact@v2-preview
# with:
# name: riftshare-linux
# path: riftshare.tar.gz
# if: matrix.os == 'ubuntu-latest'
# - name: upload artifact linux appimage
# uses: actions/upload-artifact@v2-preview
# with:
# name: riftshare-linux-appimage
# path: riftshare-${{ env.VERSION }}-x86_64.AppImage
# if: matrix.os == 'ubuntu-latest'
- name: upload artifact windows
uses: actions/upload-artifact@v2
with:
name: riftshare-windows
path: RiftShare-windows-amd64.zip
if: matrix.os == 'windows-latest'
release:
runs-on: ubuntu-latest
needs: package
steps:
- name: Download Windows Package
uses: actions/download-artifact@v2
with:
name: riftshare-windows
- name: Download macOS packages
uses: actions/download-artifact@v2
with:
name: riftshare-macOS
- name: Create Release
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: RiftShare*.zip
# - name: Download linux package
# uses: actions/download-artifact@v1
# with:
# name: riftshare-linux
# - name: Upload Linux package to release
# id: upload-linux-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./riftshare-linux/riftshare.tar.gz
# asset_name: riftshare_${{ github.ref }}_linux_x86_64.tar.gz
# asset_content_type: application/octet-stream