Build wikilite #57
Workflow file for this run
This file contains hidden or 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: Build wikilite | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-macos-amd64: | |
| name: Build for MacOS AMD64 | |
| runs-on: macos-15-intel | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - name: Build wikilite for MacOS AMD64 | |
| run: make | |
| - name: Compress artifact | |
| run: tar -C build/bin -czvf wikilite-macos-amd64.tar.gz wikilite | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-macos-amd64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-macos-arm64: | |
| name: Build for MacOS ARM64 | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - name: Build wikilite for MacOS ARM64 | |
| run: make | |
| - name: Compress artifact | |
| run: tar -C build/bin -czvf wikilite-macos-arm64.tar.gz wikilite | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-macos-arm64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-linux-amd64: | |
| name: Build for Linux AMD64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - name: Build wikilite for Linux AMD64 | |
| run: make static | |
| - name: Compress artifact | |
| run: tar -C build/bin -czvf wikilite-linux-amd64.tar.gz wikilite | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-linux-amd64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-linux-arm64: | |
| name: Build for Linux ARM64 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - name: Build wikilite for Linux ARM64 | |
| run: make static | |
| - name: Compress artifact | |
| run: tar -C build/bin -czvf wikilite-linux-arm64.tar.gz wikilite | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-linux-arm64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-linux-arm32: | |
| name: Build for Linux ARM32 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build static wikilite for Linux ARM32 using Docker | |
| run: | | |
| docker run --rm \ | |
| --platform linux/arm/v7 \ | |
| -v ${{ github.workspace }}:/src \ | |
| -w /src \ | |
| arm32v7/ubuntu:24.04 \ | |
| bash -c "apt-get update && \ | |
| apt-get install -y build-essential cmake golang git && \ | |
| git config --global --add safe.directory /src && \ | |
| make static" | |
| - name: Compress artifact | |
| run: tar -C build/bin -czvf wikilite-linux-arm32.tar.gz wikilite | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-linux-arm32.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-termux-arm32: | |
| name: Build for Termux ARM32 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Clone termux-packages | |
| run: | | |
| git clone --depth=1 https://github.com/termux/termux-packages.git | |
| - name: Copy package files | |
| run: | | |
| mkdir -p termux-packages/packages/ | |
| cp -r ./android/termux/packages/* termux-packages/packages/ | |
| - name: Build wikilite package | |
| run: | | |
| cd termux-packages | |
| ./scripts/run-docker.sh ./build-package.sh -a arm --format pacman wikilite | |
| - name: Extract binary and create clean tar.gz | |
| run: | | |
| cd termux-packages/output | |
| tar -xf wikilite-*.pkg.tar.xz | |
| tar -czvf ../../wikilite-termux-arm32.tar.gz -C data/data/com.termux/files/usr/bin wikilite | |
| - name: Upload termux binary artifact | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-termux-arm32.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-termux-arm64: | |
| name: Build for Termux ARM64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Clone termux-packages | |
| run: | | |
| git clone --depth=1 https://github.com/termux/termux-packages.git | |
| - name: Copy package files | |
| run: | | |
| mkdir -p termux-packages/packages/ | |
| cp -r ./android/termux/packages/* termux-packages/packages/ | |
| - name: Build wikilite package | |
| run: | | |
| cd termux-packages | |
| ./scripts/run-docker.sh ./build-package.sh -a aarch64 --format pacman wikilite | |
| - name: Extract binary and create clean tar.gz | |
| run: | | |
| cd termux-packages/output | |
| tar -xf wikilite-*.pkg.tar.xz | |
| tar -czvf ../../wikilite-termux-arm64.tar.gz -C data/data/com.termux/files/usr/bin wikilite | |
| - name: Upload termux binary artifact | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-termux-arm64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-windows-amd64: | |
| name: Build for Windows AMD64 | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install MinGW | |
| run: | | |
| choco install mingw -y | |
| - name: Build wikilite for Windows AMD64 | |
| shell: bash | |
| run: | | |
| rm -rf build | |
| mkdir build | |
| cd build | |
| cmake -G "MinGW Makefiles" .. | |
| make | |
| - name: Package artifacts into a Zip file | |
| run: | | |
| mkdir release | |
| copy build/bin/wikilite.exe release\ | |
| copy build\bin\*.dll release\ | |
| copy C:\mingw64\bin\libwinpthread-1.dll release\ | |
| copy C:\mingw64\bin\libstdc++-6.dll release\ | |
| copy C:\mingw64\bin\libgcc_s_seh-1.dll release\ | |
| Compress-Archive -Path release\* -DestinationPath wikilite-windows-amd64.zip | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: wikilite-windows-amd64.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-android: | |
| needs: [build-termux-arm32, build-termux-arm64] | |
| name: Build for Android | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup ARM32 JNI library | |
| run: | | |
| mkdir -p android/app/src/main/jniLibs/armeabi-v7a | |
| curl -L "https://github.com/${{ github.repository }}/releases/latest/download/wikilite-termux-arm32.tar.gz" | tar -xz -C android/app/src/main/jniLibs/armeabi-v7a/ | |
| mv android/app/src/main/jniLibs/armeabi-v7a/wikilite android/app/src/main/jniLibs/armeabi-v7a/libwikilite.so | |
| - name: Setup ARM64 JNI library | |
| run: | | |
| mkdir -p android/app/src/main/jniLibs/arm64-v8a | |
| curl -L "https://github.com/${{ github.repository }}/releases/latest/download/wikilite-termux-arm64.tar.gz" | tar -xz -C android/app/src/main/jniLibs/arm64-v8a/ | |
| mv android/app/src/main/jniLibs/arm64-v8a/wikilite android/app/src/main/jniLibs/arm64-v8a/libwikilite.so | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Build AAB | |
| run: | | |
| cd android && ./gradlew bundleRelease --no-daemon --warning-mode all | |
| - name: Sign AAB | |
| id: sign_app_aab | |
| uses: kevin-david/zipalign-sign-android-release@v2 | |
| with: | |
| releaseDirectory: android/app/build/outputs/bundle/release | |
| signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} | |
| alias: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
| keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: "34.0.0" | |
| - name: Copy | |
| run: | | |
| cp android/app/build/outputs/bundle/release/app-release.aab wikilite-android.aab | |
| - name: Build APK | |
| run: | | |
| cd android && ./gradlew assembleRelease --no-daemon --warning-mode all | |
| - name: Sign APK | |
| id: sign_app_apk | |
| uses: kevin-david/zipalign-sign-android-release@v2 | |
| with: | |
| releaseDirectory: android/app/build/outputs/apk/release | |
| signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} | |
| alias: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
| keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: "34.0.0" | |
| - name: Copy | |
| run: | | |
| cp android/app/build/outputs/apk/release/app-release-unsigned-signed.apk wikilite-android.apk | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| wikilite-android.apk | |
| wikilite-android.aab | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |