-
Notifications
You must be signed in to change notification settings - Fork 27
131 lines (111 loc) · 4.02 KB
/
build-workflow.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
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
name: Build pakkit
on: push
jobs:
build-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install Wine
run: sudo apt update && sudo apt install wine64
- name: Install node-prune
run: curl -sf https://gobinaries.com/tj/node-prune | sh
- run: npm install
- name: Build for Windows
run: |
npx electron-forge package --platform win32
cd out/pakkit-win32-x64/resources/app/; node-prune
- name: Build for Linux
run: |
npx electron-forge package --platform linux
cd out/pakkit-linux-x64/resources/app/; node-prune
- run: chmod +x out/pakkit-linux-x64/pakkit
- name: Build for macOS
run: |
npx electron-forge package --platform darwin
cd out/pakkit-darwin-x64/pakkit.app/Contents/Resources/app/; node-prune
- name: Create archives for new release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
mv out/pakkit-win32-x64 pakkit-windows-x64
mv out/pakkit-linux-x64 pakkit-linux-x64
mv out/pakkit-darwin-x64 pakkit-macos-x64
zip -r -y out/pakkit-windows-x64.zip pakkit-windows-x64/
zip -r -y out/pakkit-linux-x64.zip pakkit-linux-x64/
zip -r -y out/pakkit-macos-x64.zip pakkit-macos-x64/
- name: Create release
id: create_release
uses: actions/create-release@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: github-${{ github.run_number }}
release_name: GitHub build ${{ github.run_number }}
body: github-${{ github.run_number }}
- name: Upload Windows build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-windows-x64.zip
asset_name: pakkit-windows-x64-v${{ github.run_number }}.zip
asset_content_type: application/zip
- name: Upload Linux build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-linux-x64.zip
asset_name: pakkit-linux-x64-v${{ github.run_number }}.zip
asset_content_type: application/zip
- name: Upload macOS build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-macos-x64.zip
asset_name: pakkit-macos-x64-v${{ github.run_number }}.zip
asset_content_type: application/zip
- name: Prepare to upload artifacts
if: ${{ github.ref != 'refs/heads/master' }}
run: |
mkdir out/windows
mkdir out/linux
mkdir out/macos
mv out/pakkit-win32-x64 out/windows/pakkit-windows-x64
mv out/pakkit-linux-x64 out/linux/pakkit-linux-x64
mv out/pakkit-darwin-x64 out/macos/pakkit-macos-x64
- name: Upload Windows artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-windows-x64
path: out/windows/
- name: Upload Linux artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-linux-x64
path: out/linux/
- name: Upload macOS artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-macos-x64
path: out/macos/