v0.1.0 #1
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: Build for Windows | |
on: | |
# Enable manual run | |
workflow_dispatch: | |
push: | |
tags: | |
- '**' | |
jobs: | |
get-version: | |
name: Get version | |
runs-on: ubuntu-latest | |
outputs: | |
buildName: ${{ steps.get_version.outputs.buildName }} | |
buildNumber: ${{ steps.get_version.outputs.buildNumber }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get version | |
id: get_version | |
run: | | |
# get buildName from pubspec.yaml (before the +) | |
buildName=$(grep -oP '(?<=version: ).*(?=\+)' pubspec.yaml) | |
echo "buildName=$buildName" >> $GITHUB_OUTPUT | |
# get buildNumber from pubspec.yaml (after the +) | |
buildNumber=$(grep -oP '(?<=version: ).*' pubspec.yaml | grep -oP '(?<=\+).*$') | |
echo "buildNumber=$buildNumber" >> $GITHUB_OUTPUT | |
build-windows: | |
name: Build for Windows | |
runs-on: windows-latest | |
needs: get-version | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: flutter pub get | |
- name: Build Windows | |
shell: bash | |
run: | | |
flutter build windows | |
- name: Download Visual C++ Redistributable | |
shell: bash | |
run: | | |
curl -L -o installers/vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe | |
- name: Build Windows Installer | |
run: ISCC.exe installers/desktop_inno_script.iss | |
- name: Rename exe | |
id: rename | |
shell: bash | |
run: | | |
installerName="RicochlimeInstaller_v${{ needs.get-version.outputs.buildName }}.exe" | |
echo "installerName=$installerName" >> $GITHUB_OUTPUT | |
mv installers/RicochlimeInstaller.exe installers/$installerName | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Ricochlime-Windows | |
path: installers/${{ steps.rename.outputs.installerName }} | |
- name: Upload to GitHub release | |
uses: svenstaro/upload-release-action@v2 | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: installers/${{ steps.rename.outputs.installerName }} |