Skip to content

update workflow

update workflow #124

Workflow file for this run

on:
workflow_dispatch:
push:
tags:
- '*'
name: "Build & Release"
jobs:
build:
name: Build & Release
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
# https://github.com/subosito/flutter-action/issues/278
# - name: Export pub environment variable
# run: |
# if [ "$RUNNER_OS" == "Windows" ]; then
# echo "PUB_CACHE=$LOCALAPPDATA\\Pub\\Cache" >> $GITHUB_ENV
# fi
# shell: bash
- run: echo "NEW_VERSION=${{ github.ref_name }}" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Bump MyAppVersion in Inno Setup
run: |
(Get-Content -Path "inno-setup.iss") -replace '#define MyAppVersion "[\d\.]+"', "#define MyAppVersion `"${{ env.NEW_VERSION }}`"" | Set-Content -Path "inno-setup.iss"
shell: pwsh
- run: flutter gen-l10n
working-directory: gui
- run: dart run build_runner build --delete-conflicting-outputs
working-directory: common
- run: dart run build_runner build --delete-conflicting-outputs
working-directory: gui
- name: Build revitool CLI
run: dart compile exe common/bin/main.dart -o revitool.exe --define=APP_VERSION=${{ env.NEW_VERSION }}
- name: Enable Administrator Privileges for revitool CLI app
shell: pwsh
run: |
& "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22621.0\x64\mt.exe" -nologo -manifest common/app.manifest -outputresource:revitool.exe;1
- name: Build revitool GUI
run: flutter build windows --build-name=${{ env.NEW_VERSION }} --build-number=1 --obfuscate --split-debug-info=/symbols --dart-define=APP_VERSION=${{ env.NEW_VERSION }}
working-directory: gui
- name: Build Installer
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno-setup.iss"
shell: cmd
- name: Calculate SHA256 hash
run: |
$hash = Get-FileHash "RevisionTool-Setup.exe" -Algorithm SHA256
echo "SHA256_HASH=$($hash.Hash)" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOKEN }}
file: RevisionTool-Setup.exe
asset_name: RevisionTool-Setup.exe
tag: ${{ github.ref }}
overwrite: true
body: "SHA256: `${{ env.SHA256_HASH }}`"