Merge pull request #17 from guchengxi1994/master #15
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
name: Build Linux App | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.19.5 | |
- name: Cache pubspec | |
id: cache-pubspec | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.FLUTTER_HOME }}/.pub-cache | |
**/.flutter-plugins | |
**/.flutter-plugin-dependencies | |
**/.dart_tool/package_config.json | |
key: pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
pubspec- | |
- name: Install Rust Toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
rustup default stable | |
- name: install dependencies | |
run: | | |
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y | |
chmod +x /home/runner/work/all_in_one/all_in_one/rust_builder/cargokit/run_build_tool.sh | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Bump build number | |
run: | | |
flutter pub global activate cider | |
- name: Build Linux app | |
run: flutter build linux --release -v | |
- name: Set tag name | |
run: echo "tag_name=v$(cider version)" >> $GITHUB_ENV | |
- name: List files in build directory | |
run: ls -la build/linux/x64/release/bundle/ | |
# - name: Upload build artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: linux-app | |
# path: build/linux/x64/release/bundle/ | |
- name: Archive release | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: 'linux.zip' | |
directory: build/linux/x64/release/bundle/ | |
- name: Publish release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: build/linux/x64/release/bundle/linux.zip | |
generateReleaseNotes: true | |
tag: ${{ env.tag_name }} | |
token: ${{ secrets.RELEASE_TOKEN }} |