Skip to content

Build Windows Packages #3

Build Windows Packages

Build Windows Packages #3

name: Build Windows Packages
on:
workflow_dispatch:
jobs:
get_version:
runs-on: ubuntu-latest
outputs:
app_version: ${{ steps.fetch_version.outputs.app_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Fetch Version
id: fetch_version
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "::set-output name=app_version::$app_version"
build_and_push:
name: Build and Push Windows Packages
needs: get_version
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
tools/key_replace_windows_amd64
shell: pwsh
- name: Setup Inno Setup 6
run: |-
tools/innosetup-6.3.3.exe /VERYSILENT
Copy-Item "./tools/ChineseSimplified.isl" -Destination "C:\Program Files (x86)\Inno Setup 6\Languages"
shell: pwsh
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Distribute Packages
run: |
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform windows --targets exe,msix
- name: Rename Packages
run: |
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.msix ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.msix
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.exe ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
- name: Upload msix Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64_msix
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.msix
compression-level: 9
- name: Upload exe Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64_exe
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
compression-level: 9