-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (96 loc) · 3.08 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build and Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [win, linux, mac]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build for ${{ matrix.platform }}
run: npm run package-${{ matrix.platform }}
- name: Install zip utility
run: sudo apt-get install -y zip
- name: Archive build artifacts
run: |
if [ "${{ matrix.platform }}" == "win" ]; then
zip -r dist/topaz-win.zip dist/Topaz-win32-x64/
elif [ "${{ matrix.platform }}" == "linux" ]; then
zip -r dist/topaz-linux.zip dist/Topaz-linux-x64/
elif [ "${{ matrix.platform }}" == "mac" ]; then
zip -r dist/topaz-mac.zip dist/Topaz-darwin-x64/
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-build
path: dist/
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download Windows build artifacts
uses: actions/download-artifact@v3
with:
name: win-build
path: dist/
- name: Download Linux build artifacts
uses: actions/download-artifact@v3
with:
name: linux-build
path: dist/
- name: Download Mac build artifacts
uses: actions/download-artifact@v3
with:
name: mac-build
path: dist/
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Topaz ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Windows 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: dist/topaz-win.zip
asset_name: topaz-win.zip
asset_content_type: application/zip
- name: 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: dist/topaz-linux.zip
asset_name: topaz-linux.zip
asset_content_type: application/zip
- name: Upload Mac 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: dist/topaz-mac.zip
asset_name: topaz-mac.zip
asset_content_type: application/zip