Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Dec 10, 2023
1 parent 3a3da43 commit f042581
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 10 deletions.
72 changes: 64 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ jobs:
python-version: '3.8'
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }}
wget -q ${{ secrets.SECRET_WSALT }}
cd ../..
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
cat >> lib/server/salt.dart << EOF
String getValid(foo) {return foo;}
EOF
cat >> lib/server/wsalt.dart << EOF
String getValid(foo) {return foo;}
EOF
python3 preprocess-ios.py
- name: Podfile
run: |
Expand All @@ -48,6 +54,56 @@ jobs:
name: ipa-build
path: Payload.ipa

# https://github.com/AppImageCrafters/appimage-builder-flutter-example/blob/main/.github/workflows/appimage.yml
linux-build:
name: Build
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
# with:
# flutter-version: '1.22.4'
- run: flutter channel beta
- run: flutter upgrade
- run: flutter config --enable-linux-desktop
- name: "Install dependencies"
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: Build flutter app
run: |
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
python3 preprocess-linux.py
cat >> lib/server/salt.dart << EOF
String getValid(foo) {return foo;}
EOF
cat >> lib/server/wsalt.dart << EOF
String getValid(foo) {return foo;}
EOF
flutter build linux
- 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*'
- name: Release AppImage
uses: marvinpinto/action-automatic-releases@latest
with:
title: Continuous build
automatic_release_tag: 'continuous'
prerelease: true
draft: false
files: './*.AppImage*'
repo_token: ${{ secrets.GITHUB_TOKEN }}

android-build:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,10 +122,10 @@ jobs:
python-version: '3.8'
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }}
wget -q ${{ secrets.SECRET_WSALT }}
cd ../..
# cd lib/server
# wget -q ${{ secrets.SECRET_SALT }}
# wget -q ${{ secrets.SECRET_WSALT }}
# cd ../..
python3 preprocess-android.py
- name: Build
run: |
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
/AppDir/
*.AppImage
*.appimage

# Web related
lib/generated_plugin_registrant.dart
Expand Down Expand Up @@ -62,4 +65,4 @@ emulator.bat
img/*
test/db
test/*.7z
test/rawdata-korean
test/rawdata-korean
73 changes: 73 additions & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
script:
- rm -rf AppDir || true
- cp -r build/linux/x64/release/bundle AppDir
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
- cp assets/images/logo.png AppDir/usr/share/icons/hicolor/64x64/apps/
AppDir:
path: ./AppDir
app_info:
id: org.appimagecrafters.hello-flutter
name: Hello Flutter
icon: logo
version: latest
exec: hello_flutter
exec_args: $@
apt:
arch: amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
- sourceline: deb http://security.ubuntu.com/ubuntu bionic-security main restricted
- sourceline: deb http://security.ubuntu.com/ubuntu bionic-security universe
- sourceline: deb http://security.ubuntu.com/ubuntu bionic-security multiverse
include:
- libgtk-3-0
exclude:
- humanity-icon-theme
- hicolor-icon-theme
- adwaita-icon-theme
- ubuntu-mono
files:
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
runtime:
env:
GIO_MODULE_DIR: $APPDIR/usr/lib/x86_64-linux-gnu/gio/modules/
test:
fedora:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
use_host_x: true
debian:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
use_host_x: true
arch:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
use_host_x: true
centos:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
use_host_x: true
ubuntu:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
use_host_x: true
AppImage:
arch: x86_64
update-information: guess
sign-key: None

2 changes: 1 addition & 1 deletion preprocess-ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ def create_dummy_valid(path):
process_yaml(root + '/' + filename)

# create_dummy_valid('./lib/server/salt.dart')
# create_dummy_valid('./lib/server/wsalt.dart')
# create_dummy_valid('./lib/server/wsalt.dart')
112 changes: 112 additions & 0 deletions preprocess-linux.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# This source code is a part of Project Violet.
# Copyright (C) 2021.violet-team. Licensed under the Apache-2.0 License.

import sys
import os
import os.path
import re

target = 'linux'

def process_dart(path):
f = open(path, 'r')
w = []
nl = False
op = False
for line in f.readlines():
if '//' in line:
annote = re.split(r': |, | ',line.split('//')[-1].strip())

if not annote[0].startswith('@dependent'):
if nl or op:
nl = False
else:
w.append(line)
continue

if annote[1] == target:
w.append(line)
continue

if len(annote) == 2:
continue

if annote[2] == '=>':
nl = True
continue

if annote[2] == '[':
op = True
continue

if annote[2] == ']':
op = False
continue
else:
if nl or op:
nl = False
else:
w.append(line)
f.close()
f = open(path, 'w+')
f.writelines(w)
f.close()

def process_yaml(path):
f = open(path, 'r')
w = []
nl = False
op = False
for line in f.readlines():
if '#' in line:
annote = re.split(r': |, | ', line.split('#')[-1].strip())

if not annote[0].startswith('@dependent'):
if nl or op:
nl = False
else:
w.append(line)
continue

if annote[1] == target:
w.append(line)
continue

if len(annote) == 2:
continue

if annote[2] == '=>':
nl = True
continue

if annote[2] == '[':
op = True
continue

if annote[2] == ']':
op = False
continue
else:
if nl or op:
nl = False
else:
w.append(line)
f.close()
f = open(path, 'w+')
f.writelines(w)
f.close()

def create_dummy_valid(path):
f = open(path, 'w')
f.writelines(['String getValid(foo) {return foo;}'])
f.close()

for root, subdirs, files in os.walk('./'):
for filename in files:
if filename.endswith(".dart"):
process_dart(root + '/' + filename)
elif filename.endswith(".yaml"):
process_yaml(root + '/' + filename)

# create_dummy_valid('./lib/server/salt.dart')
# create_dummy_valid('./lib/server/wsalt.dart')

0 comments on commit f042581

Please sign in to comment.