fix: android add version #59
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: Setup Windows 10 SDK version 10.0.20348.0 | |
uses: GuillaumeFalourd/[email protected] | |
with: | |
sdk-version: 20348 | |
- name: Install NSIS | |
run: | | |
iwr -useb get.scoop.sh -outfile 'install.ps1' | |
.\install.ps1 -RunAsAdmin | |
scoop update | |
scoop install main/xmake | |
- uses: actions/checkout@v3 | |
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 -vD | |
tree /f .xmake\windows\x64\repositories\xrepo | |
xmake build -y onscripter | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
with: | |
fetch-depth: 1 | |
- name: build-x64 | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: | | |
xmake f -c -y -vD | |
xmake build -y onscripter | |
- name: build-arm64 | |
env: | |
VERSION: ${{ github.ref_name }} | |
ARCH: arm64 | |
run: | | |
xmake f -a arm64 -c -y -vD | |
xmake build -y onscripter | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: onscripter-osx-${{ github.run_id }} | |
path: | | |
dist/onscripter-darwin-x86_64 | |
dist/onscripter-darwin-arm64 | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
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: | | |
cd project/android | |
echo "org.gradle.java.home=${JAVA_HOME_11_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 -vD | |
xmake build -y onscripter | |
- name: cc-32 | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install gcc-multilib:i386 g++-multilib:i386 libstdc++-11-dev:i386 | |
- name: build-arm-so | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: | | |
xmake f -p android -a armeabi-v7a --ndk_sdkver=16 --ndk=${ANDROID_HOME}/ndk/23.2.8568313 -y -c -vD | |
xmake build -y onscripter | |
- name: build-apk | |
run: | | |
export JAVA_HOME=$JAVA_HOME_11_X64 | |
cd project/android | |
./gradlew assembleRelease | |
cp ./app/build/outputs/apk/release/app-release.apk ../../dist/onscripter-release.apk | |
cd ../../ | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
with: | |
name: onscripter-windows-${{ github.run_id }} | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: onscripter-osx-${{ github.run_id }} | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: onscripter-android-${{ github.run_id }} | |
path: dist | |
- name: list file | |
run: | | |
ls -R | |
- name: update | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dist/onscripter-windows-x86_64.exe | |
dist/onscripter-darwin-x86_64 | |
dist/onscripter-darwin-arm64 | |
dist/onscripter-release.apk |