Skip to content

v1.11.2

v1.11.2 #47

Workflow file for this run

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 cache
uses: actions/cache@v3
with:
path: |
build
key: ${{ runner.OS }}-ricochlime-windows-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
restore-keys: |
${{ runner.OS }}-ricochlime-windows-
- name: Remove simulator dependency
shell: bash
run: ./patches/remove_simulator_dependency.sh
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
- 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 }}