-
-
Notifications
You must be signed in to change notification settings - Fork 144
123 lines (102 loc) · 3.41 KB
/
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
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
122
123
name: Build and Release Electron App
on:
push:
tags:
- 'v*'
workflow_dispatch: # Allows manual triggering
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build Electron app
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm run build
- name: Display Build Artifacts
run: ls -l dist
- name: Upload Linux artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: build-linux
path: dist/*.zip
- name: Upload Windows artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: build-win
path: dist/*.exe
- name: Upload Mac artifact
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: build-mac
path: dist/*.dmg
- name: Sha256 Mac artifact
if: matrix.os == 'macos-latest'
run: shasum -a 256 dist/*.dmg
create_release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release name
run: node bin/github-getver.js "${{ github.event_name }}"
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release ${{ env.TAG_NAME }}
draft: false
prerelease: false
- name: Download All Release Assets
uses: actions/download-artifact@v4.1.7
with:
path: artifacts
merge-multiple: true
- name: Display Downloaded Assets
run: ls -ltR artifacts
- name: Zip Windows artifact
run: zip -r artifacts/KiriMoto-win-x64.zip artifacts/KiriMoto-win-x64.exe
- name: Upload Release Asset (Linux)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/KiriMoto-linux-x64.zip
asset_name: KiriMoto-Ubuntu-x64-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip
- name: Upload Release Asset (macOS)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/KiriMoto-mac-arm64.dmg
asset_name: KiriMoto-MacOS-arm-${{ env.TAG_NAME }}.dmg
asset_content_type: application/octet-stream
- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/KiriMoto-win-x64.zip
asset_name: KiriMoto-Win-x64-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip