Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Dec 14, 2023
1 parent b4ffcff commit 77c0d8d
Showing 1 changed file with 159 additions and 177 deletions.
336 changes: 159 additions & 177 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,169 +6,151 @@ on:
merge_group:

jobs:
ios-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
- uses: subosito/flutter-action@v2
with:
# flutter-version: '2.5.2'
channel: 'stable'
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Preprocess
run: |
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
cat << EOF > lib/server/salt.dart
String getValid(foo) {return foo;}
EOF
cat << EOF > lib/server/wsalt.dart
String getValid(foo) {return foo;}
EOF
python3 preprocess-ios.py
- name: Podfile
run: |
cd ios
rm Podfile.lock
flutter clean
flutter pub get
pod install
pod update
cd ..
- name: Build
run: |
flutter build ios --release --no-codesign
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y Payload.zip Payload/Runner.app
mv Payload.zip Payload.ipa
- name: Upload IPA
uses: actions/upload-artifact@v2
with:
name: ipa-build
path: Payload.ipa
# ios-build:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# with:
# ref: dev
# - uses: subosito/flutter-action@v2
# with:
# # flutter-version: '2.5.2'
# channel: 'stable'
# - uses: actions/setup-python@v2
# with:
# python-version: '3.8'
# - name: Preprocess
# run: |
# # cd lib/server
# # wget -q ${{ secrets.SECRET_SALT }}
# # wget -q ${{ secrets.SECRET_WSALT }}
# # cd ../..
# cat << EOF > lib/server/salt.dart
# String getValid(foo) {return foo;}
# EOF
# cat << EOF > lib/server/wsalt.dart
# String getValid(foo) {return foo;}
# EOF
# python3 preprocess-ios.py
# - name: Podfile
# run: |
# cd ios
# rm Podfile.lock
# flutter clean
# flutter pub get
# pod install
# pod update
# cd ..
# - name: Build
# run: |
# flutter build ios --release --no-codesign
# mkdir -p Payload
# mv ./build/ios/iphoneos/Runner.app Payload
# zip -r -y Payload.zip Payload/Runner.app
# mv Payload.zip Payload.ipa
# - name: Upload IPA
# uses: actions/upload-artifact@v2
# with:
# name: ipa-build
# path: Payload.ipa

# https://github.com/AppImageCrafters/appimage-builder-flutter-example/blob/main/.github/workflows/appimage.yml
linux-build:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- arch: armv7
distro: ubuntu20.04
- arch: aarch64
distro: ubuntu20.04
- arch: x64
distro: ubuntu20.04
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
if: ${{ matrix.arch == 'x64' }}
# with:
# flutter-version: '1.22.4'
# flutter-version: '1.22.4'
# - run: flutter channel beta
# - run: flutter upgrade
- run: flutter config --enable-linux-desktop
- name: flutter config --enable-linux-desktop on host
run: flutter config --enable-linux-desktop
if: ${{ matrix.arch == 'x64' }}
- name: "Install dependencies"
if: ${{ matrix.arch == 'x64' }}
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev
- name: Clone project-violet/p7zip
run: git clone https://github.com/project-violet/p7zip.git
- run: mkdir -p p7zip/bin/
- name: Build p7zip for linux/armhf
uses: pguyot/arm-runner-action@v2
id: p7zip-armv7-linux-build
with:
base_image: raspios_lite:latest
copy_artifact_path: p7zip/bin/7zr
copy_artifact_dest: p7zip/bin/7zr
commands: |
cd p7zip
make 7zr
cd ..
- name: Copy bin
run: |
mkdir -p ./assets/p7zip/linux/armv7/
sudo chmod 777 p7zip/bin/7zr
sudo chown $USER:$USER p7zip/bin/7zr
cp p7zip/bin/7zr ./assets/p7zip/linux/armv7/7zr
- name: Clean up project-violet/p7zip
run: |
cd p7zip
git add -A
git reset --hard HEAD
cd ..
- run: mkdir -p p7zip/bin/
- name: Build p7zip for linux/arm64
uses: pguyot/arm-runner-action@v2
id: p7zip-arm64-linux-build
- name: Build for linux/${{ matrix.arch }} using uraimo/run-on-arch-action
if: ${{ matrix.arch != 'x64' }}
uses: uraimo/run-on-arch-action@v2
with:
base_image: raspios_lite_arm64:latest
copy_artifact_path: p7zip/bin/7zr
copy_artifact_dest: p7zip/bin/7zr
commands: |
cd p7zip
make 7zr
cd ..
- name: Copy bin
run: |
mkdir -p ./assets/p7zip/linux/armv8/
sudo chmod 777 p7zip/bin/7zr
sudo chown $USER:$USER p7zip/bin/7zr
cp p7zip/bin/7zr ./assets/p7zip/linux/armv8/7zr
- name: Clean up project-violet/p7zip
run: |
cd p7zip
git add -A
git reset --hard HEAD
cd ..
# - name: Build p7zip for linux/x86(not yet)
# run: |
# mkdir -p ./assets/p7zip/linux/x86/
# touch ./assets/p7zip/linux/x86/7zr
- name: Build p7zip for linux/x86_64
run: |
cd p7zip
make 7zr
cd ..
- name: Copy bin
run: |
mkdir -p ./assets/p7zip/linux/x86_64/
chmod 777 p7zip/bin/7zr
cp p7zip/bin/7zr ./assets/p7zip/linux/x86_64/7zr
- name: Clean up project-violet/p7zip
run: |
cd p7zip
git add -A
git reset --hard HEAD
cd ..
- name: Build flutter app
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
run: |
apt-get update
apt-get install -y clang cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
cat << EOF > lib/server/salt.dart
String getValid(foo) {return foo;}
EOF
cat << EOF > lib/server/wsalt.dart
String getValid(foo) {return foo;}
EOF
sh << EOF
#!/bin/bash
if [ "${{ matrix.arch }}" == "armv7" ];then
apt install cmake libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev ttf-mscorefonts-installer fontconfig libsystemd-dev libinput-dev libudev-dev libxkbcommon-dev
apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa
git clone https://github.com/ardera/flutter-pi
cd flutter-pi
mkdir build && cd build
cmake ..
make -j`nproc`
sudo make install
export FLUTTER_BIN="flutter-pi"
elif [ "${{ matrix.arch }}" == "aarch64" ];then
git clone https://github.com/flutter/flutter.git
export PATH=$PATH:$(pwd)/flutter/bin
export FLUTTER_BIN="flutter"
fi
${FLUTTER_BIN} doctor -v
${FLUTTER_BIN} config --enable-linux-desktop
python3 preprocess-linux.py
echo flutter build linux
${FLUTTER_BIN} build linux
find ./build -type f -name '*.so'
- name: Build for linux/${{ matrix.arch }} on host
if: ${{ matrix.arch == 'x64' }}
run: |
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
git clone https://github.com/flutter/flutter.git
export PATH=$PATH:$(pwd)/flutter/bin
flutter doctor -v
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
cat << EOF > lib/server/salt.dart
String getValid(foo) {return foo;}
EOF
cat << EOF > lib/server/wsalt.dart
String getValid(foo) {return foo;}
EOF
python3 preprocess-linux.py
echo flutter build linux
flutter build linux
find ./build/linux/x64/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/x64/release/bundle/lib/ \;
- name: Save build Artifact
uses: actions/upload-artifact@v2
with:
name: LinuxBuild
path: './build/linux/x64/release/bundle'
- name: Build AppImage unsing appimage-builder
uses: docker://appimagecrafters/appimage-builder:0.8.5
with:
entrypoint: appimage-builder
args: --recipe ./AppImageBuilder.yml --skip-test
- name: Save build Artifact
uses: actions/upload-artifact@v2
with:
name: AppImage
path: './*.AppImage*'
find ./build -type f -name '*.so'
# - name: Release AppImage
# uses: marvinpinto/action-automatic-releases@latest
# with:
Expand All @@ -179,41 +161,41 @@ jobs:
# files: './*.AppImage*'
# repo_token: ${{ secrets.GITHUB_TOKEN }}

android-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
# flutter-version: '2.5.2'
channel: 'stable'
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Preprocess
run: |
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
cat << EOF > lib/server/salt.dart
String getValid(foo) {return foo;}
EOF
cat << EOF > lib/server/wsalt.dart
String getValid(foo) {return foo;}
EOF
python3 preprocess-android.py
- name: Build
run: |
flutter clean
flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk-build
path: ./build/app/outputs/apk/release/app-release.apk
# android-build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# ref: dev
# - uses: actions/setup-java@v1
# with:
# java-version: '12.x'
# - uses: subosito/flutter-action@v1
# with:
# # flutter-version: '2.5.2'
# channel: 'stable'
# - uses: actions/setup-python@v2
# with:
# python-version: '3.8'
# - name: Preprocess
# run: |
# # cd lib/server
# # wget -q ${{ secrets.SECRET_SALT }}
# # wget -q ${{ secrets.SECRET_WSALT }}
# # cd ../..
# cat << EOF > lib/server/salt.dart
# String getValid(foo) {return foo;}
# EOF
# cat << EOF > lib/server/wsalt.dart
# String getValid(foo) {return foo;}
# EOF
# python3 preprocess-android.py
# - name: Build
# run: |
# flutter clean
# flutter build apk --release
# - name: Upload APK
# uses: actions/upload-artifact@v2
# with:
# name: apk-build
# path: ./build/app/outputs/apk/release/app-release.apk

0 comments on commit 77c0d8d

Please sign in to comment.