Skip to content

デプロイ(windows zip) #19

デプロイ(windows zip)

デプロイ(windows zip) #19

name: デプロイ(windows zip)
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
jobs:
build_for_windows:
name: Windows用ビルド
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Get Flutter version from .fvmrc
run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $env:GITHUB_ENV
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
cache: true
- name: Flutter pub get
run: |
git config --system core.longpaths true
flutter pub get
- name: Get App Version
run: |
echo "version=$(flutter pub run cider version)" >> $env:GITHUB_ENV
echo "builddir=$(pwd)" >> $env:GITHUB_ENV
- name: Build for Windows
run: |
flutter build windows --release
- name: Delete unnecessary DLL
run: |
rm build\windows\x64\runner\Release\api-ms-*.dll
rm build\windows\x64\runner\Release\concrt140.dll
rm build\windows\x64\runner\Release\msvcp*.dll
rm build\windows\x64\runner\Release\ucrtbas*.dll
rm build\windows\x64\runner\Release\vc*.dll
- name: Get translation files for Inno Setup
run: |
curl -o ${{ env.builddir }}\ChineseSimplified.isl https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
with:
path: windows/innosetup.iss
options: /dMyAppVersion="${{ env.version }}" /dMyWorkDir="${{ env.builddir }}" /Qp
- name: Rename .EXE Installer
run: mv miria-installer.exe miria-installer_${env:version}_x64.exe
- name: Compress files
run: |
ren build\windows\x64\runner\Release Miria
Compress-Archive -Path build\windows\x64\runner\Miria -DestinationPath miria_${env:version}_windows-x64.zip -Force
- name: Create tag and release note
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v${env:version} miria_${env:version}_windows-x64.zip miria-installer_${env:version}_x64.exe