Skip to content

v20.2.9

v20.2.9 #106

# This is a basic workflow to help you get started with Actions
name: Build Package
# Controls when the workflow will run
on:
release:
types: [published]
jobs:
build_ios:
runs-on: macos-latest
env:
SHEME: Runner
BUILD_CONFIGURATION: Release
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Git submodule init
uses: snickerbockers/submodules-init@v4
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
channel: 'stable'
- name: Restore packages
run: flutter pub get
- name: Build Flutter
run: flutter build ios --release --no-codesign -v
- name: Build xArchive
run: |
mkdir Payload && mv build/ios/iphoneos/Runner.app Payload && zip -r Payload.zip Payload && mkdir output && mv Payload.zip output/ikaros.ipa
- name: Upload ipa to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: output/ikaros.ipa
asset_name: ikaros-ios-${{ github.ref_name }}.ipa
build_android:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Git submodule init
uses: snickerbockers/submodules-init@v4
- name: Setup Java to compile Android project
uses: actions/setup-java@v1
with:
java-version: '17.x'
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
channel: 'stable'
- name: Restore packages
run: flutter pub get
- name: Build Android App Bundle
run: flutter build apk --release -v --split-per-abi
- name: Publish Armeabi V7a Android Artefacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
asset_name: ikaros-android-armeabi-v7a-${{ github.ref_name }}.apk
- name: Publish Armeabi V8a Android Artefacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
asset_name: ikaros-android-arm64-v8a-${{ github.ref_name }}.apk
- name: Publish x86_64 Android Artefacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: build/app/outputs/flutter-apk/app-x86_64-release.apk
asset_name: ikaros-android-x86_64-${{ github.ref_name }}.apk
- name: Rename package files
run: |
cd build/app/outputs/flutter-apk
for f in *app*; do mv "$f" "${f/app/ikaros-android}"; done
for f in *release*; do mv "$f" "${f/release/${{ github.ref_name }}}"; done
- name: Upload Package To Cloudflare R2
uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: build/app/outputs/flutter-apk
destination-dir: ./${{ github.ref_name }}/
build_windows:
runs-on: windows-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Git submodule init
uses: snickerbockers/submodules-init@v4
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
channel: 'stable'
- name: Restore packages
run: flutter pub get
- name: Build Windows App Bundle
run: flutter build windows --release -v
- name: Zip release files
run: Compress-Archive -Path "build\\windows\\x64\\runner\\Release\\*" -DestinationPath "output.zip"
- name: Publish Windows Artefacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: output.zip
asset_name: ikaros-windows-${{ github.ref_name }}.zip
- name: Create directory and move/rename file
run: |
mkdir output
Move-Item -Path "output.zip" -Destination "output\\ikaros-windows-${{ github.ref_name }}.zip"
shell: pwsh
- name: Upload Package To Cloudflare R2
uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: output
destination-dir: ./${{ github.ref_name }}/
# build_macos:
# runs-on: macos-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Git submodule init
# uses: snickerbockers/submodules-init@v4
#
# - name: Set up Flutter
# uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.24.1'
# channel: 'stable'
#
# - name: Set up CocoaPods
# run: |
# sudo gem install cocoapods
#
# - name: Update macOS deployment target
# run: |
# # Navigate to the macos directory
# cd macos
#
# # Ensure Podfile exists and update macOS deployment target
# if [ -f Podfile ]; then
# sed -i '' "s/platform :macos, .*/platform :macos, '12.6'/" Podfile
# fi
#
# - name: Install dependencies
# run: |
# flutter pub get --pubspec=pubspec_macos.yaml
# cd macos
# pod install
#
# - name: Build macOS app
# run: flutter build macos --pubspec=pubspec_macos.yaml --release -v
#
# - name: Set APP_NAME
# run: |
# APP_NAME=$(ls build/macos/Build/Products/Release/ | grep -E '\.app$')
# echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
#
# - name: Create DMG Installer
# run: |
# mkdir -p build/macos/Build/Products/Release/dmg
# hdiutil create build/macos/Build/Products/Release/dmg/${{ env.APP_NAME }}-macOS.dmg \
# -volname "IkarosApp Installer" \
# -srcfolder build/macos/Build/Products/Release/${{ env.APP_NAME }} \
# -ov -format UDZO
#
# - name: Publish Macos Artefacts
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
# file: build/macos/Build/Products/Release/dmg/${{ env.APP_NAME }}-macOS.dmg
# asset_name: ikaros-macOS-${{ github.ref_name }}.dmg
build_linux:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Git submodule init
uses: snickerbockers/submodules-init@v4
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
channel: 'stable'
- name: Restore packages
run: flutter pub get
- name: Enable linux desktop
run: flutter config --enable-linux-desktop
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build cmake g++ libgtk-3-dev vlc libvlc-dev
- name: Build Linux App Bundle
run: flutter build linux --release -v
- name: Set environment variables
run: |
echo "APP_NAME=ikaros" >> $GITHUB_ENV
VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create a tarball
run: |
mkdir -p build/linux/x64/release/${{ env.APP_NAME }}
cp -r build/linux/x64/release/bundle/* build/linux/x64/release/${{ env.APP_NAME }}/
tar -czvf build/linux/x64/release/${{ env.APP_NAME }}-linux.tar.gz -C build/linux/x64/release ${{ env.APP_NAME }}
- name: Publish Linux Artefacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: build/linux/x64/release/${{ env.APP_NAME }}-linux.tar.gz
asset_name: ikaros-linux-${{ github.ref_name }}.tar.gz