fix: android use jdk17 #106
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-windows: | |
name: windows build | |
runs-on: windows-latest | |
steps: | |
- name: Install NSIS | |
run: | | |
iwr -useb get.scoop.sh -outfile 'install.ps1' | |
.\install.ps1 -RunAsAdmin | |
scoop update | |
scoop install main/xmake | |
$env:path+=";$Home\scoop\shims" | |
xmake --version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: build-x86_64 | |
env: | |
VERSION: ${{ github.ref_name }} | |
shell: powershell | |
run: | | |
$env:path+=";$Home\scoop\shims" | |
xmake f -c -y | |
tree /f .xmake\windows\x64\repositories\xrepo | |
xmake build -y onscripter | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: onscripter-windows-${{ github.run_id }} | |
path: | | |
dist/onscripter-windows-x86_64.exe | |
build-osx: | |
name: macos build | |
runs-on: macos-latest | |
steps: | |
- name: install-xmake | |
run: | | |
brew install xmake | |
xmake --version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: build-x64 | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: | | |
xmake f -c -y --target_minver=10.13 | |
xmake build -y onscripter | |
- name: build-arm64 | |
env: | |
VERSION: ${{ github.ref_name }} | |
ARCH: arm64 | |
run: | | |
xmake f -a arm64 -c -y --target_minver=12.01 | |
xmake build -y onscripter | |
- name: build-iphone | |
env: | |
VERSION: ${{ github.ref_name }} | |
ARCH: arm64 | |
run: | | |
xmake f -p iphoneos --target_minver=12.0 -y -c | |
xmake b onscripter-oc | |
xmake package onscripter-oc | |
cp build/iphoneos/arm64/release/onscripter-oc.ipa dist/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: onscripter-osx-${{ github.run_id }} | |
path: | | |
dist/onscripter-darwin-x86_64 | |
dist/onscripter-darwin-arm64 | |
dist/onscripter-oc.ipa | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: install-xmake | |
run: | | |
./script/xmake-install.sh xmake-amd64.deb | |
sudo apt-get install -y ./xmake-amd64.deb | |
rm ./xmake-amd64.deb | |
xmake --version | |
- name: cert | |
env: | |
CERT_TEXT: ${{ secrets.CERT_TEXT }} | |
VERSION: ${{ github.ref_name }} | |
run: | | |
export JAVA_HOME=$JAVA_HOME_17_X64 | |
cd project/android | |
echo "org.gradle.java.home=${JAVA_HOME_17_X64}" >> gradle.properties | |
echo "versionName=${VERSION}" >> local.properties | |
echo "$CERT_TEXT" > cert.txt | |
cat cert.txt | base64 -d > cert.tar.xz | |
tar -xf cert.tar.xz | |
rm cert.tar.xz cert.txt | |
ls -lh keystore.properties release.keystore | |
cd ../../ | |
mkdir -p dist | |
- name: build-arm64-so | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: | | |
xmake f -p android -a arm64-v8a --ndk_sdkver=21 --ndk=${ANDROID_NDK} -y -c | |
xmake build -y onscripter | |
- name: build-apk | |
run: | | |
export JAVA_HOME=$JAVA_HOME_17_X64 | |
echo $JAVA_HOME | |
cd project/android | |
./gradlew assembleRelease | |
cp ./app/build/outputs/apk/release/app-release.apk ../../dist/onscripter-release.apk | |
cd ../../ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: onscripter-android-${{ github.run_id }} | |
path: | | |
dist/onscripter-release.apk | |
update-release: | |
runs-on: ubuntu-latest | |
needs: [build-osx, build-windows, build-android] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: onscripter-windows-${{ github.run_id }} | |
path: dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: onscripter-osx-${{ github.run_id }} | |
path: dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: onscripter-android-${{ github.run_id }} | |
path: dist | |
- name: list file | |
run: | | |
ls -R | |
- name: update | |
uses: softprops/action-gh-release@975c1b265e11dd76618af1c374e7981f9a6ff44a | |
if: startsWith(github.ref, 'refs/tags/') && github.ref_name != 'v0.0.0' | |
with: | |
files: | | |
dist/onscripter-windows-x86_64.exe | |
dist/onscripter-darwin-x86_64 | |
dist/onscripter-darwin-arm64 | |
dist/onscripter-release.apk | |
dist/onscripter-oc.ipa |