Skip to content

Commit

Permalink
chore: Commit some code
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Aug 27, 2023
1 parent 4aa5ef1 commit c23dbaa
Show file tree
Hide file tree
Showing 13 changed files with 306 additions and 235 deletions.
213 changes: 130 additions & 83 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,99 +12,85 @@ env:
APP_NAME: ADBKIT

jobs:
build-linux:
runs-on: ubuntu-latest
environment: default
steps:

- name: Checkout the code
uses: actions/checkout@v3

- name: Checkout behavior_api code
uses: actions/checkout@v3
with:
repository: 'mengyanshou/behavior_api'
token: ${{ secrets.GH_PAT }}
ref: 'main'
path: "${{ github.workspace }}/behavior_api"

- name: move file
run: |
ls ${{ github.workspace }}
mv "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
mv "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- run: flutter config --enable-linux-desktop

- name: Building
run: flutter build linux
# build-linux:
# runs-on: ubuntu-latest
# environment: default
# steps:

# - name: Checkout the code
# uses: actions/checkout@v3

# - name: Checkout behavior_api code
# uses: actions/checkout@v3
# with:
# repository: 'mengyanshou/behavior_api'
# token: ${{ secrets.GH_PAT }}
# ref: 'main'
# path: "${{ github.workspace }}/behavior_api"

# - name: move file
# run: |
# ls ${{ github.workspace }}
# mv "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
# mv "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart

# - name: Install and set Flutter version
# uses: subosito/flutter-action@v2
# with:
# channel: 'stable'

# - run: |
# sudo apt-get update -y
# sudo apt-get install -y ninja-build libgtk-3-dev
# - run: flutter config --enable-linux-desktop

# - name: Building
# run: flutter build linux

- name: Packaging
run: ./scripts/build/generate_linux.sh
# - name: Packaging
# run: ./scripts/build/generate_linux.sh

- name: Release
run: |
curl --upload-file "${{ env.APP_NAME }}.deb" https://transfer.sh/${{ env.APP_NAME }}.deb
# - name: Release
# run: |
# curl --upload-file "${{ env.APP_NAME }}.deb" https://transfer.sh/${{ env.APP_NAME }}.deb

build-mac:
# The type of runner that the job will run on
runs-on: macos-latest
# runs-on: macos-latest
runs-on: self-hosted
environment: default

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Checkout the code
uses: actions/checkout@v3

- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
channel: 'stable'
ref: ${{ github.event.client_payload.ref }}

- name: Checkout behavior_api code
- name: Checkout adb_kit_extension code
uses: actions/checkout@v3
with:
repository: 'mengyanshou/behavior_api'
repository: 'mengyanshou/adb_kit_extension'
token: ${{ secrets.GH_PAT }}
ref: 'main'
path: "${{ github.workspace }}/behavior_api"

- name: move file
run: |
mv "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
mv "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart
- name: Building
run: |
flutter config --enable-macos-desktop
- name: Packaging
run: |
./scripts/build/generate_mac_app.sh
- name: Release
run: |
curl --upload-file ${{ env.APP_NAME }}.tar https://transfer.sh/${{ env.APP_NAME }}_macOS.tar
build-windows:
# The type of runner that the job will run on
runs-on: windows-latest
environment: default
path: "${{ github.workspace }}/adb_kit_extension"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout termux_api_plugin code
uses: actions/checkout@v3
with:
repository: 'nightmare-space/termux_api_plugin'
token: ${{ secrets.GH_PAT }}
ref: 'main'
path: "${{ github.workspace }}/termux_api_plugin"

- name: Checkout the code
- name: Checkout user_center_frontend code
uses: actions/checkout@v3
with:
repository: 'mengyanshou/user_center_frontend'
token: ${{ secrets.GH_PAT }}
ref: 'main'
path: "${{ github.workspace }}/user_center_frontend"

- name: Checkout behavior_api code
uses: actions/checkout@v3
Expand All @@ -114,26 +100,87 @@ jobs:
ref: 'main'
path: "${{ github.workspace }}/behavior_api"

- name: Checkout ni CLI code
uses: actions/checkout@v3
with:
repository: 'mengyanshou/ni'
token: ${{ secrets.GH_PAT }}
ref: 'main'
path: "${{ github.workspace }}/ni"

- name: move file
run: |
move "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
move "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart
mv "${{ github.workspace }}/user_center_frontend" "${{ github.workspace }}/../user_center_frontend"
mv "${{ github.workspace }}/adb_kit_extension" "${{ github.workspace }}/../adb_kit_extension"
mv "${{ github.workspace }}/termux_api_plugin" "${{ github.workspace }}/../termux_api_plugin"
mv "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
mv "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart
- name: Setup node environment
uses: actions/setup-node@v2

- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Building...

- name: Setup CLI environment
run: |
flutter config --enable-windows-desktop
flutter build windows --dart-define=VERSION=${{ github.event.client_payload.version }} --dart-define=VERSION_CODE=${{ github.event.client_payload.version_code }}
cd ${{ github.workspace }}/ni
dart pub get
- name: Setup other environment
run: npm install -g appdmg

- name: Packaging
- name: Building&&Packaging
run: |
.\scripts\patch_executable.bat
Compress-Archive -Path .\build\windows\runner\Release\* -DestinationPath ${{ env.APP_NAME }}_Windows.zip
export PATH=$PATH:${{ github.workspace }}/ni
ni release --build-mac-dmg
- name: Release
- name: Upload
run: |
curl --upload-file ${{ env.APP_NAME }}_Windows.zip https://transfer.sh/${{ env.APP_NAME }}_Windows.zip
export PATH=$PATH:${{ github.workspace }}/ni
ni default -u
# build-windows:
# # The type of runner that the job will run on
# runs-on: windows-latest
# environment: default

# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:

# - name: Checkout the code
# uses: actions/checkout@v3

# - name: Checkout behavior_api code
# uses: actions/checkout@v3
# with:
# repository: 'mengyanshou/behavior_api'
# token: ${{ secrets.GH_PAT }}
# ref: 'main'
# path: "${{ github.workspace }}/behavior_api"

# - name: move file
# run: |
# move "${{ github.workspace }}/behavior_api/behavior.dart" ./lib/global/instance/behavior.dart
# move "${{ github.workspace }}/behavior_api/behavior.g.dart" ./lib/global/instance/behavior.g.dart

# - name: Install and set Flutter version
# uses: subosito/flutter-action@v2
# with:
# channel: 'stable'

# - name: Building...
# run: |
# flutter config --enable-windows-desktop
# flutter build windows --dart-define=VERSION=${{ github.event.client_payload.version }} --dart-define=VERSION_CODE=${{ github.event.client_payload.version_code }}

# - name: Packaging
# run: |
# .\scripts\patch_executable.bat
# Compress-Archive -Path .\build\windows\runner\Release\* -DestinationPath ${{ env.APP_NAME }}_Windows.zip

# - name: Release
# run: |
# curl --upload-file ${{ env.APP_NAME }}_Windows.zip https://transfer.sh/${{ env.APP_NAME }}_Windows.zip
15 changes: 14 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}
},
{
"label": "Mac: Generate Mac App",
"label": "Mac: Generate Mac App(tar)",
"type": "shell",
"command": "ni",
"args": [
Expand All @@ -79,6 +79,19 @@
"isDefault": true
}
},
{
"label": "Mac: Generate Mac App(dmg)",
"type": "shell",
"command": "ni",
"args": [
"release",
"--build-mac-dmg"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Default: Upload Build Package",
"type": "shell",
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

COCOAPODS: 1.11.3
COCOAPODS: 1.12.0
2 changes: 1 addition & 1 deletion macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading

0 comments on commit c23dbaa

Please sign in to comment.