Build linux #7
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| env: | |
| PUB_CACHE: ${{ github.workspace }}/.pub-cache | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| # optional parameters follow | |
| cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | |
| cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
| pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies | |
| pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
| - run: flutter --version | |
| - run: sudo apt update && sudo apt install ninja-build libgtk-3-dev | |
| - run: flutter build linux | |
| - name: Compress binary | |
| run: | | |
| cd build/linux/x64/release/bundle | |
| tar -czvf shock_alarm_linux_x64.tar.gz * | |
| cd ../../../../../ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ShockAlarm-Linux-x64 | |
| path: build/linux/x64/release/bundle/shock_alarm_linux_x64.tar.gz |