Skip to content

Commit 9fd1ada

Browse files
committed
feat: add release workflow and update ARM naming convention
1 parent 04289f2 commit 9fd1ada

2 files changed

Lines changed: 83 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
changelog:
7+
description: 'Changelog for this release'
8+
required: true
9+
default: 'Minor updates and fixes'
10+
version:
11+
description: 'Version tag (e.g. v1.0.0)'
12+
required: true
13+
default: 'v1.0.0'
14+
15+
jobs:
16+
build:
17+
name: Build on ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm]
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up JDK 21
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: '21'
31+
distribution: 'temurin'
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.x'
37+
38+
- name: Install Dependencies (Linux)
39+
if: contains(matrix.os, 'ubuntu')
40+
run: sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev
41+
42+
- name: Build and Package
43+
run: python3 scripts/build.py
44+
45+
- name: Upload Artifacts
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: live2d-jars-${{ matrix.os }}
49+
path: out/*.jar
50+
51+
publish:
52+
needs: build
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Download all artifacts
58+
uses: actions/download-artifact@v4
59+
with:
60+
path: all-jars
61+
62+
- name: Prepare Release Assets
63+
run: |
64+
mkdir assets
65+
find all-jars -name "*.jar" -exec cp {} assets/ \;
66+
ls -R assets
67+
68+
- name: Create Release
69+
uses: softprops/action-gh-release@v2
70+
with:
71+
tag_name: ${{ github.event.inputs.version }}
72+
name: Release ${{ github.event.inputs.version }}
73+
body: ${{ github.event.inputs.changelog }}
74+
files: assets/*.jar
75+
draft: false
76+
prerelease: false
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/build.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ def get_tag():
5555
os_name = platform.system().lower()
5656
arch = platform.machine().lower()
5757
p = "macos" if "darwin" in os_name else os_name
58-
# Handle aarch64 vs arm64 naming
59-
a = "arm64" if ("arm" in arch or "aarch64" in arch) else "x64"
58+
59+
if "arm" in arch or "aarch64" in arch:
60+
a = "arm" if p == "linux" else "arm64"
61+
else:
62+
a = "x64"
6063
return f"{p}-{a}"
6164

6265
def build():

0 commit comments

Comments
 (0)