forked from nodegui/nodegui
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (87 loc) · 2.76 KB
/
release.yml
File metadata and controls
98 lines (87 loc) · 2.76 KB
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
name: Build and Deploy to npm
on:
release:
types: [published]
jobs:
precompile:
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
strategy:
matrix:
include:
- os: ubuntu-24.04
platform: linux
arch: x64
- os: windows-2025
platform: win32
arch: x64
- os: macos-14
platform: darwin
arch: arm64
runs-on: ${{ matrix.os }}
env:
ARCHIVE_FILENAME: nodegui-binary-${{github.event.release.tag_name}}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Update apt
if: contains(matrix.platform, 'linux')
run: sudo apt update
- name: Install ubuntu deps
if: contains(matrix.platform, 'linux')
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
- name: Install deps
run: npm install
- name: Build nodegui
run: npm run build
env:
CMAKE_BUILD_PARALLEL_LEVEL: 8
- name: Compress files
if: ${{!contains(matrix.platform, 'win32')}}
uses: a7ul/tar-action@v1.0.2
id: compress
with:
command: c
cwd: ./build/Release
files: |
./nodegui_core.node
outPath: ${{ env.ARCHIVE_FILENAME }}
- name: Compress files (Windows)
if: contains(matrix.platform, 'win32')
uses: a7ul/tar-action@v1.0.2
id: compress-windows
with:
command: c
cwd: ./build/Release
files: |
./nodegui_core.node
./nodegui_core.lib
outPath: ${{ env.ARCHIVE_FILENAME }}
- uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_FILENAME }}
path: ${{ env.ARCHIVE_FILENAME }}
- name: Upload release binaries
run: |
gh release upload "${{github.event.release.tag_name}}" ${{ env.ARCHIVE_FILENAME }}
env:
GITHUB_TOKEN: ${{ github.token }}
publish-npm-package:
needs: precompile
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install ubuntu deps
run: sudo apt update
- run: sudo apt install mesa-common-dev libglu1-mesa-dev
- run: npm install
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
- run: npm publish --access=public
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
CMAKE_BUILD_PARALLEL_LEVEL: 8