-
Notifications
You must be signed in to change notification settings - Fork 79
96 lines (81 loc) · 2.86 KB
/
main-build.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
name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: [arm64, amd64]
- os: macos-latest
arch: [arm64, amd64]
- os: windows-latest
arch: [arm64, amd64]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build Prepare (macOS)
if: runner.os == 'macOS'
run: |
brew install python-setuptools
- name: Install Dependencies
run: npm install
- name: Build Release Files
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set Build Name ( Linux / macOS )
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
DIST_FILE_NAME=${{ runner.os }}-${{ runner.arch }}-v$(date +%Y%m%d_%H%M%S)-${RANDOM}
echo ::add-mask::$DIST_FILE_NAME
echo DIST_FILE_NAME=$DIST_FILE_NAME >> $GITHUB_ENV
- name: Set Build Name ( Windows )
if: runner.os == 'Windows'
shell: pwsh
run: |
$randomNumber = Get-Random -Minimum 10000 -Maximum 99999
$DIST_FILE_NAME = "Windows-X64-v$(Get-Date -Format 'yyyyMMdd_HHmmss')-$randomNumber"
Write-Host "::add-mask::$DIST_FILE_NAME"
echo "DIST_FILE_NAME=$DIST_FILE_NAME" >> $env:GITHUB_ENV
- name: Upload
uses: modstart/github-oss-action@master
with:
title: ${{ github.event.head_commit.message }}
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: ${{ secrets.OSS_REGION }}
bucket: ${{ secrets.OSS_BUCKET }}
callback: ${{ secrets.OSS_CALLBACK }}
assets: |
dist-release/*.exe:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.dmg:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.AppImage:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.deb:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
- name: Upload Artifact Windows
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: |
dist-release/*.exe
- name: Upload Artifact Macos
uses: actions/upload-artifact@v4
with:
name: macos-artifact
path: |
dist-release/*.dmg
- name: Upload Artifact Linux
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: |
dist-release/*.AppImage
dist-release/*.deb