-
-
Notifications
You must be signed in to change notification settings - Fork 16
139 lines (118 loc) · 3.89 KB
/
build-and-release-binary.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
name: Build & Publish Binaries
on:
workflow_dispatch:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
schedule:
- cron: '0 13-21/2 * * *' # every 2 hours during US Eastern daytime
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.11.1
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9.12.3
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build server
run: pnpm turbo typecheck --filter=@tunarr/server
- name: Build web
run: pnpm turbo typecheck --filter=@tunarr/web
build:
needs: typecheck
strategy:
matrix:
os:
- name: macos-13
target_name: macos
binary_name: macos-x64
- name: macos-latest
target_name: macos-arm64
binary_name: macos-arm64
- name: ubuntu-latest
target_name: linux
binary_name: linux-x64
- name: windows-latest
target_name: windows
binary_name: windows-x64
# - name: ubuntu-latest
# target_name: linux-arm64
# binary_name: linux-arm64
node_version: [20.11.1]
runs-on: ${{matrix.os.name}}
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4 # Checkout code from repository
with:
ref: dev
- uses: ilammy/setup-nasm@v1
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.11.1
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9.12.3
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: 'Create env file'
run: |
touch server/.env
echo TUNARR_BUILD="$(git rev-parse --short ${{ github.sha }})" >> server/.env
echo TUNARR_EDGE_BUILD=true
cat server/.env
if: github.ref == format('refs/heads/{0}', 'dev') && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
- name: Bundle server
run: pnpm turbo bundle --filter=@tunarr/server
- name: Bundle web
run: pnpm turbo bundle --filter=@tunarr/web
- name: Build Executable
run: pnpm run --filter=server make-exec:${{ matrix.os.target_name }}
- name: Upload Edge Binary
uses: softprops/action-gh-release@v2
with:
name: Tunarr Edge
tag_name: edge
prerelease: true
files: |
./server/build/tunarr-${{ matrix.os.binary_name }}.zip*
if: github.ref == format('refs/heads/{0}', 'dev') && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
- name: Upload Binaries
uses: softprops/action-gh-release@v2
with:
files: |
./server/build/tunarr-${{ matrix.os.binary_name }}.zip*
if: startsWith(github.ref, 'refs/tags/')