-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (159 loc) · 5.61 KB
/
CI-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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: "CI Release"
on:
workflow_run:
workflows:
- "CI build"
types:
- "completed"
jobs:
# Generate and upload executables to Github releases
upload-executables-macos:
name: macos-x64
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Get latest release tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate macos-x64 executable
run: yarn pkg . -t node16-macos-x64 -o plebbit_macos-x64 --compress Brotli
- name: Upload file to release
uses: svenstaro/upload-release-action@v2
with:
file: plebbit_macos-x64
tag: ${{ steps.previoustag.outputs.tag }}
overwrite: true
upload-executables-linux:
name: linux-x64
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Get latest release tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Install dependencies
run: |
sudo apt install -y gcc g++ make git build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev libfontconfig1 fontconfig libfontconfig1-dev libfontconfig
yarn install --frozen-lockfile
- name: Generate single executable
run: yarn pkg . -t node16-linux-x64 -o plebbit_linux-x64 --compress Brotli
- name: Upload file to release
uses: svenstaro/upload-release-action@v2
with:
file: plebbit_linux-x64
tag: ${{ steps.previoustag.outputs.tag }}
overwrite: true
upload-executables-windows-single-exe:
name: windows-x64-exe
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Get latest release tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate single executable
run: yarn pkg . -t node16-win-x64 -o plebbit_win-x64_portable.exe --compress Brotli
- name: Upload file to release
uses: svenstaro/upload-release-action@v2
with:
file: plebbit_win-x64_portable.exe
tag: ${{ steps.previoustag.outputs.tag }}
overwrite: true
upload-executables-windows-installer:
name: windows-x64-installer
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Get latest release tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate installer
run: yarn oclif pack win
- name: Rename installer
shell: bash
run: find dist/win32/ -name *x64.exe -exec bash -c 'mv $0 plebbit_win-x64_installer.exe' {} \;
- name: Upload installer to release
uses: svenstaro/upload-release-action@v2
with:
file: plebbit_win-x64_installer.exe
tag: ${{ steps.previoustag.outputs.tag }}
overwrite: true
upload-executables-linux-arm64:
name: linux-arm64
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: "Get latest release tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
image_additional_mb: 2048
import_github_env: true
bind_mount_repository: true
commands: |
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
sudo apt update
sudo apt-get install -y nodejs gcc g++ make git build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev libfontconfig1 fontconfig libfontconfig1-dev libfontconfig
npm install --global yarn
yarn install --frozen-lockfile
yarn pkg . -t node16-linux-arm64 -o plebbit_linux-arm64 --compress Brotli
- name: Upload Binary releases
uses: svenstaro/upload-release-action@v2
with:
file: plebbit_linux-arm64
tag: ${{ steps.previoustag.outputs.tag }}
overwrite: true