Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Compressed Images (#1) #30

Compressed Images (#1)

Compressed Images (#1) #30

Workflow file for this run

name: Flutter build
on: [push, release, pull_request]
jobs:
build-windows:
runs-on: windows-2022
defaults:
run:
working-directory: app
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v3
- name: Get flutter version
shell: bash
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
- name: ✅ Enable platforms
run: flutter config --enable-windows-desktop
- name: 📦 Get dependencies
run: |
flutter clean
flutter pub get
flutter doctor -v
- name: 🏭 Build
shell: pwsh
run: |
flutter build windows -v --release
- name: Archive
uses: actions/upload-artifact@v3
with:
name: windows-build
path: |
app/build/windows/runner/Release/**
- name: Archive
uses: actions/upload-artifact@v3
with:
name: windows-setup
path: |
app/build/windows/linwood-launch-windows-setup.exe
build-linux:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: app
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v3
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip \
python3-setuptools \
desktop-file-utils \
libgdk-pixbuf2.0-dev \
fakeroot \
strace \
fuse \
libgtk-3-dev \
libx11-dev \
pkg-config \
cmake \
ninja-build \
libblkid-dev \
liblzma-dev \
clang \
dpkg-dev \
patchelf \
alien \
libsecret-1-dev \
libjsoncpp-dev
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
- name: ✅ Enable platforms
run: flutter config --enable-linux-desktop
- name: 📦 Get dependencies
run: |
flutter clean
flutter pub get
flutter doctor -v
- name: 🏭 Build
run: |
flutter build linux -v --release
- name: Build .deb executable
run: |
cp -fr build/linux/x64/release/bundle linux/debian/usr/bin
dpkg-deb --build --root-owner-group linux/debian
cp linux/*.deb linwood-launch-linux.deb
#- name: Build .rpm executable
# run: |
# cd app
# alien -r linwood-launch-linux.deb
# mv linwood-launch*.rpm linwood-launch-linux.rpm
- name: Build .AppImage executable
run: |
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.0.0-beta.1/appimage-builder-1.0.0-677acbd-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
appimage-builder --recipe AppImageBuilder.yml --skip-test
- name: Copy nessessary files
run: |
cp images/logo.svg build/linux/x64/release/bundle/dev.linwood.launch.svg
mkdir -p build/linux/x64/release/bundle/usr/share
cp -r linux/debian/usr/share build/linux/x64/release/bundle/usr
- name: Rename AppImage
run: |
mv ./*.AppImage* linwood-launch-linux.AppImage
- name: Archive
uses: actions/upload-artifact@v3
with:
name: linux-build
path: |
app/build/linux/x64/release/bundle/**
- name: Archive .deb
uses: actions/upload-artifact@v3
with:
name: linux-deb
path: |
app/linwood-launch-linux.deb
#- name: Archive .rpm
# uses: actions/upload-artifact@v3
# with:
# name: linux-rpm
# path: |
# app/linwood-launch-linux.rpm
- name: Archive .AppImage
uses: actions/upload-artifact@v3
with:
name: linux-appimage
path: |
app/linwood-launch-linux.AppImage
build-flatpak:
name: Build flatpak
runs-on: ubuntu-20.04
defaults:
run:
working-directory: app
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v3
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip \
python3-setuptools \
desktop-file-utils \
libgdk-pixbuf2.0-dev \
fakeroot \
strace \
fuse \
libgtk-3-dev \
libx11-dev \
pkg-config \
cmake \
ninja-build \
libblkid-dev \
liblzma-dev \
clang \
dpkg-dev \
patchelf \
alien \
libsecret-1-dev \
libjsoncpp-dev
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
- name: ✅ Enable platforms
run: flutter config --enable-linux-desktop
- name: 📦 Get dependencies
run: |
flutter clean
flutter pub get
flutter doctor -v
- name: 🏭 Build
run: |
flutter build linux -v --release
- name: Copy nessessary files
run: |
cp images/logo.svg build/linux/x64/release/bundle/dev.linwood.launch.svg
mkdir -p build/linux/x64/release/bundle/usr/share
cp -r linux/debian/usr/share build/linux/x64/release/bundle/usr
- name: Compress Flutter build
run: tar -C build/linux/x64/release/bundle -czf linwood-launch-linux-portable.tar.gz .
# - name: Install flatpak
# run: |
# sudo apt-get update
# sudo apt-get install -y flatpak
# - name: Install dependencies
# run: |
# flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user
# flatpak install flathub org.flatpak.Builder --user -y --arch=x86_64
# - name: Build .flatpak
# timeout-minutes: 15
# run: |
# flatpak run org.flatpak.Builder -v --force-clean --sandbox --delete-build-dirs --user --install-deps-from=flathub --arch=x86_64 flatpak_app flatpak.json --bundle-sources
# flatpak build-export export flatpak_app -v
# flatpak build-bundle export linwood-launch-linux.flatpak dev.linwood.launch -v
# - name: Upload .flatpak artifact to workflow
# uses: actions/upload-artifact@v3
# with:
# name: linux-flatpak
# path: app/linwood-launch-linux.flatpak
- name: Archive old portable
uses: actions/upload-artifact@v3
with:
name: linux-alternative-portable
path: app/build/linux/x64/release/bundle
#build-macos:
# runs-on: macos-latest
# defaults:
# run:
# working-directory: app
# steps:
# - name: ⬆️ Checkout
# uses: actions/checkout@v3
# - name: Get flutter version
# run: |
# FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
# echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ env.FLUTTER_VERSION }}
# channel: 'any'
# - name: ✅ Enable platforms
# run: flutter config --enable-macos-desktop
# - name: 📦 Get dependencies
# run: |
# flutter clean
# flutter pub get
# flutter doctor -v
# - name: 🏭 Build
# run: |
# flutter build macos -v
# - name: Archive
# uses: actions/upload-artifact@v3
# with:
# name: macos-build
# path: |
# app/build/macos/Build/Products/Release/launch.app
deploy:
runs-on: ubuntu-22.04
if: github.event_name == 'push'
outputs:
version: ${{ steps.setup.outputs.LAUNCH_VERSION }}
build_number: ${{ steps.setup.outputs.LAUNCH_BUILD_NUMBER }}
needs:
- build-windows
- build-linux
- build-flatpak
#- build-macos
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v3
env:
CI_PAT: ${{ secrets.CI_PAT }}
with:
token: ${{ env.CI_PAT }}
- name: Setup git
id: setup
run: |
LAUNCH_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${LAUNCH_VERSION_REGEX}" app/pubspec.yaml) =~ ${LAUNCH_VERSION_REGEX} ]]
LAUNCH_VERSION="${BASH_REMATCH[1]}"
echo "LAUNCH_VERSION=${LAUNCH_VERSION}" >> $GITHUB_ENV
echo "LAUNCH_VERSION=${LAUNCH_VERSION}" >> $GITHUB_OUTPUT
LAUNCH_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "LAUNCH_BUILD_NUMBER=${LAUNCH_BUILD_NUMBER}" >> $GITHUB_ENV
echo "LAUNCH_BUILD_NUMBER=${LAUNCH_BUILD_NUMBER}" >> $GITHUB_OUTPUT
git config --global user.email "[email protected]"
git config --global user.name "Linwood CI"
- uses: actions/download-artifact@v3
with:
name: windows-build
path: windows-build/
- uses: actions/download-artifact@v3
with:
name: linux-build
path: linux-build/
- uses: actions/download-artifact@v3
with:
name: linux-deb
#- uses: actions/download-artifact@v3
# with:
# name: linux-rpm
- uses: actions/download-artifact@v3
with:
name: linux-appimage
#- uses: actions/download-artifact@v3
# with:
# name: linux-flatpak
- uses: actions/download-artifact@v3
with:
name: linux-alternative-portable
path: linux-alternative-portable/
- uses: actions/download-artifact@v3
with:
name: windows-setup
#- uses: actions/download-artifact@v3
# with:
# name: macos-build
# path: macos-build/
- name: 📦 Zip artifacts
run: |
zip -r linwood-launch-windows.zip windows-build/*
tar -C linux-build -czf linwood-launch-linux.tar.gz .
tar -C linux-alternative-portable -czf linwood-launch-linux-alternative.tar.gz .
# tar -C macos-build -czf linwood-launch-macos.tar.gz .
- name: Configure git
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' }}
run: |
git --version
git config --global user.email "[email protected]"
git config --global user.name "Actions"
git pull --tags
- name: 🚀 Deploy stable
if: ${{ github.ref == 'refs/tags/stable' }}
uses: softprops/action-gh-release@v1
continue-on-error: true
with:
prerelease: true
tag_name: stable
files: |
linwood-launch-windows-setup.exe
linwood-launch-windows.zip
linwood-launch-linux.tar.gz
linwood-launch-linux-alternative.tar.gz
linwood-launch-linux.deb
linwood-launch-linux.AppImage
# linwood-launch-macos.tar.gz
# linwood-launch-linux.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🚀 Deploy nightly
if: ${{ github.ref == 'refs/tags/nightly' }}
uses: softprops/action-gh-release@v1
continue-on-error: true
with:
prerelease: true
tag_name: nightly
files: |
linwood-launch-windows-setup.exe
linwood-launch-windows.zip
linwood-launch-linux.tar.gz
linwood-launch-linux-alternative.tar.gz
linwood-launch-linux.deb
linwood-launch-linux.AppImage
# linwood-launch-macos.tar.gz
# linwood-launch-linux.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
continue-on-error: true
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
linwood-launch-windows-setup.exe
linwood-launch-windows.zip
linwood-launch-linux.tar.gz
linwood-launch-linux-alternative.tar.gz
linwood-launch-linux.deb
linwood-launch-linux.AppImage
# linwood-launch-macos.tar.gz
# linwood-launch-linux.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}