Skip to content

build: fix snap by building libmpv #62

build: fix snap by building libmpv

build: fix snap by building libmpv #62

name: App Linux Release
on:
push:
branches: [ main ]
jobs:
linux:
name: Build and create linux release
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Create version
id: version
run: echo "version=$(grep ^version pubspec.yaml |cut -f 2 -d ' '|cut -f 1 -d '+')" >> $GITHUB_OUTPUT
- name: Get HEAD short sha
id: short_sha
run: echo "short_sha=$(echo ${{ github.sha }}|head -c 7)" >> $GITHUB_OUTPUT
shell: bash
- name: set HEAD git short sha in config.dart
run: sed -i "/commit/s/HEAD/${{ steps.short_sha.outputs.short_sha }}/" lib/config.dart
shell: bash
- uses: subosito/flutter-action@v2
with:
channel : 'stable'
cache: true
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv
- name: fix git repo in flutter install
if: ${{ env.ACT }}
run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-*
- run: flutter pub get
#- run: flutter test
- run: flutter config --enable-linux-desktop
- name: install cmake [act]
if: ${{ env.ACT }}
run: sudo apt install -y cmake clang
- run: flutter build linux --release
- run: mv build/linux/x64/release/bundle build/linux/x64/release/flarte-${{ steps.version.outputs.version }}/
- name: Archive release
uses: thedoctor0/[email protected]
with:
type: 'tar'
directory: 'build/linux/x64/release/'
path: 'flarte-${{ steps.version.outputs.version }}'
filename: 'flarte-linux_x64.tar.gz'
- name: Create a release in GitHub
if: ${{ !env.ACT }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'build/linux/x64/release/flarte-linux_x64.tar.gz'
token: "${{ secrets.GH_TOKEN }}"
tag: "v${{ steps.version.outputs.version }}"
commit: "${{ github.sha }}"