-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (97 loc) Β· 3.28 KB
/
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
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
npm:
name: Release to npm
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Dependencies
run: npm ci
cache: 'npm'
- name: Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
outputs:
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
determine-client-version:
needs: npm
name: Determine client version
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
id: getPublishedPackages
env:
PUBLISHED_PACKAGES: ${{needs.npm.outputs.publishedPackages}}
with:
script: |
const publishedPackages = JSON.parse(process.env.PUBLISHED_PACKAGES);
const clientPackage = publishedPackages.find((pkg) => pkg.name === '@quory/client');
if (!clientPackage) {
return null;
}
console.info(`Found published client version: ${clientPackage.version}`);
return clientPackage.version;
outputs:
# publishedClientVersion: ${{ steps.getPublishedPackages.outputs.result }}
publishedClientVersion: '1.0.3'
electron:
needs: determine-client-version
if: needs.determine-client-version.outputs.publishedClientVersion
name: Build and distribute Electron packages for Mac, Windows and Linux
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false # keep going with other operating systems if one fails
runs-on: ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Build JS packages
run: npm run build
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: npm --workspace @quory/client run build:linux
- name: Build Mac
if: matrix.os == 'macos-latest'
run: npm --workspace @quory/client run build:mac
- name: Build Windows
if: matrix.os == 'windows-latest'
run: npm --workspace @quory/client run build:win
- name: Upload to release
uses: softprops/action-gh-release@v1
with:
tag_name: '@quory/client@${{ needs.determine-client-version.outputs.publishedClientVersion }}'
append_body: true
files: |
packages/client/dist/*.exe
packages/client/dist/*.zip
packages/client/dist/*.dmg
packages/client/dist/*.AppImage
packages/client/dist/*.snap
packages/client/dist/*.deb
packages/client/dist/*.rpm
packages/client/dist/*.tar.gz
packages/client/dist/*.yml
packages/client/dist/*.blockmap