-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (96 loc) · 2.91 KB
/
publish.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
name: Publish
on:
push:
tags:
- "*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
client-build:
name: "Build Client"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: "app/client"
sparse-checkout-cone-mode: false
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Set Versions
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = context.ref.substring(10).replace('v', '')
core.setOutput('tag', tag)
core.setOutput('version', tag.split("-")[0])
- name: Add version to package.json
uses: jaywcjlove/github-action-package@main
with:
path: "./app/client/package.json"
data: |
{
"version": "${{ steps.set_version.outputs.tag }}"
}
- name: Install dependencies
working-directory: ./app/client
run: yarn install --frozen-lockfile
- name: Build
working-directory: ./app/client
run: yarn run build
- name: "Upload Artifact"
uses: actions/upload-artifact@v3
with:
name: client-build
path: "./app/client/build"
auth-build:
name: "Build Auth"
needs: [client-build]
runs-on: ubuntu-latest
strategy:
matrix:
os: [darwin, linux, linux_aarch64, windows]
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: "app/server"
sparse-checkout-cone-mode: false
- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Set Versions
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = context.ref.substring(10).replace('v', '')
core.setOutput('tag', tag)
core.setOutput('version', tag.split("-")[0])
- name: Replace consts.ts version
uses: richardrigutins/replace-in-files@v2
with:
files: "./app/server/mod.ts"
search-text: "__VERSION__"
replacement-text: ${{ steps.set_version.outputs.tag }}
- name: Download client-build artifact
uses: actions/[email protected]
with:
name: client-build
path: ./app/server/build/client
- name: Compile
working-directory: ./app/server
run: deno task compile:${{ matrix.os }}
- name: "Zip build"
run: |
cd ./app/server/build/
zip -r ../../../auth_${{ matrix.os }}.zip .
- name: "Upload to release"
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./auth_${{ matrix.os }}.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true