bump version to 1.14.0 #298
Workflow file for this run
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: Manual Build App | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
inputs: | |
flutter_channel: | |
description: "run with flutter channel, eg: master, beta, stable" | |
required: true | |
type: choice | |
options: | |
- 'master' | |
- 'beta' | |
- 'stable' | |
default: "stable" | |
flutter_version: | |
description: "flutter version. eg 3.19.6" | |
required: false | |
default: "" | |
platforms: | |
description: "platforms to build, eg: linux, windows" | |
required: false | |
type: choice | |
options: | |
- 'linux,windows' | |
- 'linux' | |
- 'windows' | |
default: "linux,windows" | |
push: | |
tags: | |
- 'v*' | |
env: | |
FLUTTER_VERSION: ${{ github.event.inputs.flutter_version }} | |
FLUTTER_CHANNEL: ${{ github.event.inputs.flutter_channel || 'stable' }} | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
if: contains(github.event.inputs.platforms, 'linux') || github.event.inputs.platforms == '' | |
steps: | |
# Work around https://github.com/actions/runner-images/issues/8659 | |
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8 | |
with: | |
os: ubuntu-latest | |
- run: g++ --version | |
- run: gcc --version | |
- run: sudo apt-get install libstdc++6 | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 'stable' # 'stable' or 'nightly' | |
override: true | |
components: rustfmt, clippy | |
# flutter build need ninja. | |
# https://github.com/subosito/flutter-action/issues/49 | |
- name: Patch for linux build | |
run: | | |
flutter doctor | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
sudo apt-get install libsdl2-dev | |
sudo apt-get install webkit2gtk-4.1 | |
sudo apt-get install libopus-dev libogg-dev | |
flutter doctor | |
- run: flutter --version | |
- run: flutter config --enable-linux-desktop | |
# setup webcrypto for unit test | |
- run: dart run webcrypto:setup | |
- name: Run tests | |
run: flutter test | |
- name: Build APP | |
run: flutter build linux | |
- name: Compress Flutter build | |
run: tar -C build/linux/x64/release/bundle -cvf mixin_desktop_linux_amd64_portable.tar.gz . | |
- name: Upload app archive for next steps | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mixin_desktop_linux_amd64_portable | |
path: mixin_desktop_linux_amd64_portable.tar.gz | |
- name: Package APP | |
run: ./dist/linux_deb.sh | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mixin_desktop_amd64.deb.zip | |
path: build/mixin_desktop_amd64.deb | |
- name: upload linux binary | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: mixin_desktop_linux_amd64_portable.tar.gz | |
asset_name: mixin_desktop_linux_amd64_portable.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: upload linux deb | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/mixin_desktop_amd64.deb | |
asset_name: mixin_desktop_linux_amd64.deb | |
tag: ${{ github.ref }} | |
overwrite: true | |
build-linux-snap: | |
needs: build-linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download app archive | |
uses: actions/[email protected] | |
with: | |
name: mixin_desktop_linux_amd64_portable | |
- name: uncompress app archive | |
run: | | |
mkdir -p build/linux/x64/release/bundle | |
tar -C build/linux/x64/release/bundle -xvf mixin_desktop_linux_amd64_portable.tar.gz | |
- name: Prepare snap build | |
run: ./dist/linux_snap_prepare.sh | |
- name: Build .snap | |
uses: snapcore/action-build@v1 | |
id: build-snap | |
with: | |
snapcraft-args: '--enable-experimental-extensions' | |
path: dist/snap | |
- name: copy snap | |
run: | | |
cp ${{ steps.build-snap.outputs.snap }} mixin_desktop_linux_amd64.snap | |
- name: Upload snap | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mixin-desktop-snap | |
path: mixin_desktop_linux_amd64.snap | |
- name: Upload linux snap | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ steps.build-snap.outputs.snap }} | |
asset_name: mixin_desktop_linux_amd64.snap | |
tag: ${{ github.ref }} | |
overwrite: true | |
build-linux-appimage: | |
needs: build-linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download app archive | |
uses: actions/[email protected] | |
with: | |
name: mixin_desktop_linux_amd64_portable | |
- name: uncompress app archive | |
run: | | |
mkdir -p build/linux/x64/release/bundle | |
tar -C build/linux/x64/release/bundle -xvf mixin_desktop_linux_amd64_portable.tar.gz | |
- name: Build AppImage unsing appimage-builder | |
uses: docker://appimagecrafters/appimage-builder:0.9.1 | |
with: | |
entrypoint: appimage-builder | |
args: --recipe ./AppImageBuilder.yml --skip-test | |
- run: mv "Mixin Messenger-latest-x86_64.AppImage" mixin_desktop_linux_amd64.AppImage | |
- name: Upload AppImage Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AppImage | |
path: mixin_desktop_linux_amd64.AppImage | |
- name: Upload linux AppImage | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: mixin_desktop_linux_amd64.AppImage | |
asset_name: mixin_desktop_linux_amd64.AppImage | |
tag: ${{ github.ref }} | |
overwrite: true | |
build-windows: | |
runs-on: windows-latest | |
if: contains(github.event.inputs.platforms, 'windows') || github.event.inputs.platforms == '' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 'stable' # 'stable' or 'nightly' | |
override: true | |
components: rustfmt, clippy | |
- run: flutter --version | |
# https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows/22575737#22575737 | |
- run: git config --system core.longpaths true | |
- run: flutter config --enable-windows-desktop | |
# fix error when dump debug info: (msdia*.dll unregistered?) | |
- run: regsvr32 "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Remote Debugger\x64\msdia140.dll" | |
- uses: ilammy/setup-nasm@v1 | |
- name: Build APP | |
id: build-app | |
run: | | |
$version_str=$(gc .\pubspec.yaml | select-string '(?<=^version: ).*' -AllMatches | Select-Object -Expand Matches | %{$_.Value}) | |
$version=$version_str.Split("+")[0] | |
$build_number=$version_str.Split("+")[1] | |
flutter build windows --dart-define="APP_VERSION=$version" --dart-define="APP_BUILD_NUMBER=$build_number" | |
echo "MSIX_PACKAGE_VERSION=$version.0" >> $Env:GITHUB_OUTPUT | |
- name: Build Installer | |
run: | | |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "windows_inno_setup.iss" | |
shell: cmd | |
- name: Upload Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mixin_desktop_windows_setup_amd64.exe.zip | |
path: build\mixin_desktop_windows_setup_amd64.exe | |
- name: Build msix | |
run: | | |
echo "create msix. version: ${{ steps.build-app.outputs.MSIX_PACKAGE_VERSION }}" | |
flutter pub run msix:create --build-windows false --version ${{ steps.build-app.outputs.MSIX_PACKAGE_VERSION }} -v | |
- name: Upload msix | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flutter_app.msix.zip | |
path: build\windows\x64\runner\Release\flutter_app.msix | |
- name: collect debug info | |
run: flutter pub run debug_info_collector | |
- name: Upload debug info | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows_debug_info | |
path: build\syms | |
- name: Upload windows setup exe | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/mixin_desktop_windows_setup_amd64.exe | |
asset_name: mixin_desktop_windows_setup_amd64.exe | |
tag: ${{ github.ref }} | |
overwrite: true |