Skip to content

Build Linux Packages #2

Build Linux Packages

Build Linux Packages #2

name: Build Linux Packages
on:
workflow_dispatch:
jobs:
build_and_push:
name: Build and Push Linux Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set version var
id: vars
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "app_version=$app_version" >> $GITHUB_OUTPUT
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_linux_amd64
tools/key_replace_linux_amd64
- name: Setup Dependencies
run: |
sudo apt-get update -y
sudo apt install -y locate rpm patchelf libwebkit2gtk-4.1-dev
sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libasound2-dev
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool
sudo mv appimagetool /usr/local/bin/
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Distribute Packages
run: |
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform linux --targets rpm,deb,appimage
- name: Rename Packages
run: |
mv ./dist/${{ steps.vars.outputs.app_version }}/*.deb ./dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64.deb
mv ./dist/${{ steps.vars.outputs.app_version }}/*.rpm ./dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86_64.rpm
mv ./dist/${{ steps.vars.outputs.app_version }}/*.AppImage ./dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64.AppImage
- name: Upload deb Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64_deb
path: dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64.deb
compression-level: 9
- name: Upload rpm Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64_rpm
path: dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86_64.rpm
compression-level: 9
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64_AppImage
path: dist/${{ steps.vars.outputs.app_version }}/AppRhyme_linux_${{ steps.vars.outputs.app_version }}_x86-64.AppImage
compression-level: 9