-
-
Notifications
You must be signed in to change notification settings - Fork 187
90 lines (74 loc) · 3.51 KB
/
ci.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
name: CI Build
on: [push, pull_request]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build:
name: Build all
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
name: Read repository
- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Get package.json info
id: info
uses: jaywcjlove/github-action-package@main
- name: Load cache
id: load-cache-node_modules
uses: actions/cache/restore@v3
with:
path: ./node_modules
key: node_modules-${{ hashFiles('package-lock.json') }}
enableCrossOsArchive: true
- name: Prepare dependencies for cache
if: steps.load-cache-node_modules.outputs.cache-hit != 'true'
run: npm i --install-links
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save cache
if: steps.load-cache-node_modules.outputs.cache-hit != 'true'
id: save-cache-node_modules
uses: actions/cache/save@v3
with:
path: ./node_modules
key: ${{ steps.load-cache-node_modules.outputs.cache-primary-key }}
enableCrossOsArchive: true
- name: Build assets
run: npm run parcel-build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Win32 installer
run: npm exec electron-builder -- --x64 --config.extraMetadata.versionBuild="${{ steps.info.outputs.version }}+${{ github.sha }}" --config.win.artifactName="Twinkle.Tray.v${{ steps.info.outputs.version }}.exe" --publish="never"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
name: Upload Win32 installer
with:
name: twinkle-tray-exe-${{ steps.info.outputs.version }}-${{ github.sha }}
path: dist/*.exe
- name: Build x64 AppX
if: ${{ env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'ci-test' }}
run: npm exec electron-builder -- --x64 --win appx --config.npmRebuild=false --config.extraMetadata.versionBuild="${{ steps.info.outputs.version }}+${{ github.sha }}" --config.extraMetadata.name=twinkle-tray-appx --config.win.artifactName="Twinkle.Tray.v${{ steps.info.outputs.version }}-store.appx" --publish="never"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
name: Upload x64 AppX
if: ${{ env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'ci-test' }}
with:
name: twinkle-tray-appx-x64-${{ steps.info.outputs.version }}-${{ github.sha }}
path: dist/*-store.appx
- name: Build ARM64 AppX
if: ${{ env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'ci-test' }}
run: npm exec electron-builder -- --arm64 --win appx --config.extraMetadata.versionBuild="${{ steps.info.outputs.version }}+${{ github.sha }}" --config.extraMetadata.name=twinkle-tray-appx --config.win.artifactName="Twinkle.Tray.v${{ steps.info.outputs.version }}-store-arm64.appx" --publish="never"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
name: Upload ARM64 AppX
if: ${{ env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'ci-test' }}
with:
name: twinkle-tray-appx-arm64-${{ steps.info.outputs.version }}-${{ github.sha }}
path: dist/*-store-arm64.appx