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 5f4ab41
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 9 deletions.
48 changes: 44 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,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-ios.py
- name: Podfile
run: |
Expand All @@ -48,6 +48,46 @@ jobs:
name: ipa-build
path: Payload.ipa

linux-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 ../..
python3 preprocess-linux.py
- name: Build
run: |
sudo apt-get update -y
sudo apt-get install cmake -y
sudo apt-get install ninja-build -y
sudo apt-get install clang -y
flutter clean
flutter build linux --release
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
ls
# - name: Upload AppImage
# uses: actions/upload-artifact@v2
# with:
# name: appimage-build
# path: ./build/linux/x64/release/bundle

android-build:
runs-on: ubuntu-latest
steps:
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

4 changes: 2 additions & 2 deletions preprocess-android.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def create_dummy_valid(path):
elif filename.endswith(".yaml"):
process_yaml(root + '/' + filename)

# create_dummy_valid('./lib/server/salt.dart')
# create_dummy_valid('./lib/server/wsalt.dart')
create_dummy_valid('./lib/server/salt.dart')
create_dummy_valid('./lib/server/wsalt.dart')
4 changes: 2 additions & 2 deletions preprocess-ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def create_dummy_valid(path):
elif filename.endswith(".yaml"):
process_yaml(root + '/' + filename)

# create_dummy_valid('./lib/server/salt.dart')
# create_dummy_valid('./lib/server/wsalt.dart')
create_dummy_valid('./lib/server/salt.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 5f4ab41

Please sign in to comment.