forked from AppFlowy-IO/AppFlowy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0483e30
commit eec1318
Showing
1 changed file
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: binary_thresh | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
FLUTTER_VERSION: "3.18.0-0.2.pre" | ||
RUST_TOOLCHAIN: "1.75" | ||
|
||
jobs: | ||
build-for-linux: | ||
name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] | ||
runs-on: ${{ matrix.job.os }} | ||
needs: create-release | ||
env: | ||
LINUX_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ github.ref_name }}/linux/Release | ||
LINUX_ZIP_NAME: AppFlowy-${{ matrix.job.target }}-x86_64.tar.gz | ||
LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb | ||
LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm | ||
LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
job: | ||
- { | ||
arch: x86_64, | ||
target: x86_64-unknown-linux-gnu, | ||
os: ubuntu-20.04, | ||
extra-build-args: "", | ||
flutter_profile: production-linux-x86_64, | ||
} | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "beta" | ||
flutter-version: ${{ env.FLUTTER_VERSION }} | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
target: ${{ matrix.job.target }} | ||
override: true | ||
components: rustfmt | ||
profile: minimal | ||
|
||
- name: Install prerequisites | ||
working-directory: frontend | ||
run: | | ||
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev | ||
sudo apt-get install keybinder-3.0 libnotify-dev | ||
sudo apt-get -y install alien | ||
source $HOME/.cargo/env | ||
cargo install --force cargo-make | ||
cargo install --force duckscript_cli | ||
rustup target add ${{ matrix.job.target }} | ||
- name: Install gcc-aarch64-linux-gnu | ||
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} | ||
working-directory: frontend | ||
run: | | ||
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgtk-3-0 | ||
- name: Build AppFlowy | ||
working-directory: frontend | ||
run: | | ||
flutter config --enable-linux-desktop | ||
dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }} | ||
- name: Archive Asset | ||
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} | ||
run: tar -czf ${{ env.LINUX_ZIP_NAME }} * | ||
|
||
- name: Build Linux package (.deb) | ||
working-directory: frontend | ||
run: | | ||
sh scripts/linux_distribution/deb/build_deb.sh appflowy_flutter/product/${{ github.ref_name }}/linux/Release ${{ github.ref_name }} ${{ env.LINUX_PACKAGE_DEB_NAME }} | ||
- name: Calculate .deb package size | ||
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} | ||
run: | | ||
echo "Size of the .deb package:" | ||
du -sh ${{ env.LINUX_PACKAGE_DEB_NAME }} | ||
- name: Build Linux package (.rpm) | ||
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} | ||
run: | | ||
ls -a | ||
sudo alien -r ${{ env.LINUX_PACKAGE_DEB_NAME }} | ||
echo '------------' | ||
cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }} | ||
ls -a | ||
- name: Upload Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_ZIP_NAME }} | ||
asset_name: ${{ env.LINUX_ZIP_NAME }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Debian package | ||
id: upload-release-asset-install-package-deb | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_DEB_NAME }} | ||
asset_name: ${{ env.LINUX_PACKAGE_DEB_NAME }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload RPM package | ||
id: upload-release-asset-install-package-rpm | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_RPM_NAME }} | ||
asset_name: ${{ env.LINUX_PACKAGE_RPM_NAME }} | ||
asset_content_type: application/octet-stream |