Add Podfile.lock #56
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 | |
on: | |
push: | |
workflow_dispatch: | |
merge_group: | |
jobs: | |
macos-build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Flutter | |
uses: subosito/flutter-action@main | |
- name: Podfile | |
run: | | |
cd macos | |
rm Podfile.lock | |
flutter clean | |
flutter pub get | |
pod install | |
pod update | |
- name: Build | |
run: | | |
flutter build macos | |
mkdir -p target | |
cp -R build/macos/Build/Products/Release/rdr2_session.app target/ | |
sudo chmod +x target/rdr2_session.app/Contents/MacOS/rdr2_session | |
- uses: QQxiaoming/create-dmg-action@v0.0.2 | |
with: | |
name: MacOS | |
srcdir: target | |
- name: Save build Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: MacOS | |
path: MacOS.dmg | |
windows-build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Flutter | |
uses: subosito/flutter-action@main | |
- name: Build | |
run: | | |
flutter build windows | |
Compress-Archive -Path build\windows\x64\runner\Release\* -Destination Windows.zip | |
- name: Save build Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: Windows | |
path: Windows.zip | |
# https://github.com/AppImageCrafters/appimage-builder-flutter-example/blob/main/.github/workflows/appimage.yml | |
linux-build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
# - arch: armv7 | |
# distro: ubuntu20.04 | |
# - arch: aarch64 | |
# distro: ubuntu20.04 | |
- arch: x86_64 | |
distro: ubuntu20.04 | |
steps: | |
- uses: actions/checkout@main | |
- uses: subosito/flutter-action@main | |
if: ${{ matrix.arch == 'x86_64' }} | |
# with: | |
# flutter-version: '1.22.4' | |
# - run: flutter channel beta | |
# - run: flutter upgrade | |
- name: flutter config --enable-linux-desktop on host | |
run: flutter config --enable-linux-desktop | |
if: ${{ matrix.arch == 'x86_64' }} | |
- name: "Install dependencies" | |
if: ${{ matrix.arch == 'x86_64' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev | |
- run: echo ${{ github.event.repository.name }} | |
- name: Build for linux/${{ matrix.arch }} using uraimo/run-on-arch-action | |
if: ${{ matrix.arch != 'x86_64' }} | |
uses: uraimo/run-on-arch-action@master | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ${{ matrix.distro }} | |
# https://github.com/uraimo/run-on-arch-action/issues/34 | |
setup: | | |
mkdir -p "${PWD}/build" | |
dockerRunArgs: | | |
--volume "${PWD}/build:/home/${USER}/${{ github.event.repository.name }}/${{ github.event.repository.name }}/build" | |
run: | | |
apt-get update > /dev/null | |
apt-get install -y clang cmake ninja-build build-essential pkg-config curl wget file git unzip xz-utils zip libgtk-3-dev > /dev/null | |
bash << EOF | |
if [ "${{ matrix.arch }}" == "aarch64" ];then | |
git clone https://github.com/flutter/flutter.git | |
export PATH=$PATH:$(pwd)/flutter/bin | |
flutter doctor -v | |
flutter config --enable-linux-desktop | |
python preprocess-linux.py | |
flutter build linux | |
find ./build/linux/*/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/*/release/bundle/lib/ \; | |
fi | |
EOF | |
- name: Build for linux/${{ matrix.arch }} on host | |
if: ${{ matrix.arch == 'x86_64' }} | |
run: | | |
git clone https://github.com/flutter/flutter.git | |
export PATH=$PATH:$(pwd)/flutter/bin | |
flutter doctor -v | |
echo flutter build linux | |
flutter build linux | |
find ./build -type f -name '*.so' | |
find ./build/linux/*/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/*/release/bundle/lib/ \; || true | |
find ./build -type f -name '*.so' | |
- run: find ./build -type f -name '*.so' | |
- name: Build AppImage unsing appimage-builder | |
uses: docker://appimagecrafters/appimage-builder:0.8.5 | |
with: | |
entrypoint: appimage-builder | |
args: --recipe ./AppImageBuilder-${{ matrix.arch }}.yml --skip-test | |
- name: Zip | |
run: | | |
zip Linux.zip *.AppImage* | |
- name: Save build Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: Linux | |
path: Linux.zip | |
release: | |
needs: [ macos-build,windows-build,linux-build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: | |
id: tag | |
run: | | |
echo "value=$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- uses: actions/download-artifact@main | |
with: | |
name: Linux | |
path: . | |
- uses: actions/download-artifact@main | |
with: | |
name: Windows | |
path: . | |
- uses: actions/download-artifact@main | |
with: | |
name: MacOS | |
path: . | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps.tag.outputs.value }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
Changes on this release | |
draft: false | |
prerelease: true | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./MacOS.dmg | |
asset_name: MacOS.dmg | |
asset_content_type: application/zip | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./Windows.zip | |
asset_name: Windows.zip | |
asset_content_type: application/zip | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./Linux.zip | |
asset_name: Linux.zip | |
asset_content_type: application/zip |