Windows Exe Release #32
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: Windows Exe Release | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Release Tag' | |
required: true | |
upload: | |
description: 'Upload to release?' | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure git for long paths | |
run: git config --system core.longpaths true | |
- name: Install Flutter | |
uses: subosito/[email protected] | |
with: | |
channel: stable | |
cache: true | |
- name: Flutter version | |
run: flutter --version | |
- name: Install dependencies | |
run: flutter pub get | |
# <-------- START: Utility scripts --------> | |
- name: Get Tag | |
id: GetTag | |
shell: bash | |
run: echo "tag=$(dart scripts/get_tag.dart ${{ github.event.inputs.tag }} ${{ github.ref }})" >> $GITHUB_OUTPUT | |
- name: Get Pubspec Version | |
id: GetPubspecVersion | |
shell: bash | |
run: echo "version=$(dart scripts/pubspec_version.dart)" >> $GITHUB_OUTPUT | |
# <-------- END: Utility scripts --------> | |
- name: Install Flutter distributor | |
run: flutter pub global activate flutter_distributor | |
- name: Setup Inno Installer | |
run: | | |
.\windows\packaging\exe\inno.ps1 | |
- name: Setup icon for Installer | |
run: dart scripts/windows/copy_icon.dart | |
- name: Build & Pack | |
run: flutter_distributor package --platform windows --targets exe --artifact-name=TargetMate-windows-${{ steps.GetTag.outputs.tag }}.exe | |
- name: Display structure of dist directory | |
run: ls -R dist | |
- name: Upload Workflow Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/${{ steps.GetPubspecVersion.outputs.version }}/TargetMate-windows-${{ steps.GetTag.outputs.tag }}.exe | |
if-no-files-found: error | |
retention-days: 5 | |
- name: Upload to Release | |
if: ${{ inputs.upload || github.event_name == 'release' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/${{ steps.GetPubspecVersion.outputs.version }}/TargetMate-windows-${{ steps.GetTag.outputs.tag }}.exe | |
tag: refs/tags/${{ steps.GetTag.outputs.tag }} | |
overwrite: true | |
file_glob: true |