-
Notifications
You must be signed in to change notification settings - Fork 67
77 lines (66 loc) · 2.26 KB
/
nightly.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
on:
push:
branches:
- main
- dev
- refactor
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
# Pre build
- name: Get 7-digit commit SHA
run: echo "SHORT_SHA=$("${{ github.sha }}" | cut -c1-7)" >> $env:GITHUB_ENV
- name: Insert SHA to version string
run: |
$json = Get-Content package.json -Raw | ConvertFrom-Json
$json.version += "+$env:SHORT_SHA"
$json | ConvertTo-Json | Set-Content package.json
- name: Modify electron-builder.yml
shell: pwsh
run: |
$yamlContent = Get-Content -Path electron-builder.yml -Raw
$yamlContent = $yamlContent -replace "target: 7z", "target: dir"
Set-Content -Path electron-builder.yml -Value $yamlContent
- name: Get final akari version
run: |
$AKARI_VERSION = (Get-Content package.json | ConvertFrom-Json).version
echo "akari_version=$AKARI_VERSION" >> $env:GITHUB_ENV
# Build
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Run yarn install
uses: borales/actions-yarn@v5.0.0
with:
cmd: install
- name: Install node-gyp
run: npm i node-gyp -g
- name: Build C++ addons
run: |
$addons = Get-ChildItem -Directory .\addons
Write-Host "Found addons: $($addons.Count)"
$addons | ForEach-Object -Process {
Write-Host "Processing addon: $($_.FullName)"
Set-Location $_.FullName
node-gyp configure
node-gyp build
Set-Location -Path ..\..
Copy-Item -Path "$($_.FullName)\build\Release\*.node" -Destination .\src\main\native -Force
}
- name: Run yarn build:win
uses: borales/actions-yarn@v5.0.0
with:
cmd: build:win
# Post build
- name: Upload build outputs
uses: actions/upload-artifact@v3
with:
name: League Akari-${{ env.akari_version }}
path: dist/win-unpacked