Skip to content

Commit d038279

Browse files
committed
- Update sources
- Add workflow
1 parent 14372a1 commit d038279

File tree

5 files changed

+234
-170
lines changed

5 files changed

+234
-170
lines changed

.github/workflows/main.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: MAA Star Resonance Main CI
2+
3+
permissions: write-all
4+
5+
on:
6+
push:
7+
branches: [ ci-*, main ]
8+
tags: [ pre*, v* ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
get-info:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
commitHash: ${{ steps.git-info.outputs.commitHash }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Get git info
20+
id: git-info
21+
shell: bash
22+
run: |
23+
COMMIT_HASH=$(git rev-parse --short ${{ GITHUB.SHA }})
24+
echo "commitHash=$COMMIT_HASH" >> $GITHUB_OUTPUT
25+
26+
build:
27+
runs-on: windows-latest
28+
needs: get-info
29+
env:
30+
OUTPUT_FOLDER: ./dist/electron/Packaged
31+
RELEASE_FOLDER: ./release
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
submodules: 'recursive'
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: latest
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
cache: 'pnpm'
45+
- name: Install dependencies
46+
run: pnpm install
47+
- name: Publish Electron package
48+
run: pnpm run publish
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: maa-star-resonance_${{ needs.get-info.outputs.commitHash }}_${{ GITHUB.RUN_NUMBER }}_artifacts
53+
path: |
54+
${{ env.OUTPUT_FOLDER }}/*.exe
55+
${{ env.OUTPUT_FOLDER }}/*.exe.blockmap
56+
${{ env.OUTPUT_FOLDER }}/release.yml
57+
- name: Upload other files
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: cmw-coder-quasar_${{ needs.get-info.outputs.commitHash }}_${{ GITHUB.RUN_NUMBER }}_debug
61+
path: |
62+
${{ env.OUTPUT_FOLDER }}/generic/
63+
${{ env.OUTPUT_FOLDER }}/win-unpacked/
64+
${{ env.OUTPUT_FOLDER }}/builder-debug.yml
65+
${{ env.OUTPUT_FOLDER }}/builder-effective-config.yaml
66+
- name: Prepare for release
67+
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
68+
shell: bash
69+
run: |
70+
mkdir -p ${{ env.RELEASE_FOLDER }}
71+
7z a -tzip ${{ env.RELEASE_FOLDER }}/maa-star-resonance.zip "${{ env.OUTPUT_FOLDER }}/*.exe" "${{ env.OUTPUT_FOLDER }}/*.exe.blockmap" "${{ env.OUTPUT_FOLDER }}/release.yml"
72+
- name: Upload release
73+
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
74+
uses: ncipollo/release-action@v1
75+
with:
76+
allowUpdates: true
77+
artifacts: |
78+
${{ env.RELEASE_FOLDER }}/maa-star-resonance.zip
79+
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ yarn-error.log*
3131

3232
# local .env files
3333
.env.local*
34+
35+
# log files
36+
*.log

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@vue/eslint-config-typescript": "^14.6.0",
3939
"autoprefixer": "^10.4.21",
4040
"electron": "37.2.5",
41-
"electron-builder": "^26.0.12",
41+
"electron-builder": "^26.0.19",
4242
"eslint": "^9.32.0",
4343
"eslint-plugin-vue": "^9.33.0",
4444
"globals": "^15.15.0",

0 commit comments

Comments
 (0)