Add better limit controls #40
Workflow file for this run
This file contains hidden or 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: | |
| - '**' | |
| branches: | |
| - '**' | |
| paths: | |
| - .github/workflows/windows.yml | |
| - installers/desktop_inno_script.iss | |
| jobs: | |
| build-windows: | |
| name: Build for Windows | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build | |
| key: ${{ runner.OS }}-shockalarmapp-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }} | |
| restore-keys: | | |
| ${{ runner.OS }}-shockalarmapp- | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| cache-key: 'flutter-:os:-:channel:-:version:-:arch:' | |
| - name: Disable Flutter CLI animations | |
| run: flutter config --no-cli-animations | |
| - run: flutter pub get | |
| - name: Add version | |
| shell: pwsh | |
| run: | | |
| ./generate_iss.ps1 | |
| - name: Build Windows | |
| shell: bash | |
| run: | | |
| cat windows/ShockAlarmSetup.iss | |
| flutter build windows | |
| - name: Download Visual C++ Redistributable | |
| shell: bash | |
| run: | | |
| curl -L -o windows/vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe | |
| - name: Build Windows Installer | |
| run: ISCC.exe windows/ShockAlarmSetup.iss | |
| - name: Rename exe | |
| id: rename | |
| shell: bash | |
| run: | | |
| export LC_ALL=en_US.utf8 | |
| buildName=$(git describe --tags $(git rev-list --tags --max-count=1)) | |
| installerName="ShockAlarmApp.Windows.Setup.${buildName}.exe" | |
| echo "installerName=$installerName" >> $GITHUB_OUTPUT | |
| echo "buildName=$buildName" >> $GITHUB_OUTPUT | |
| mv windows/Output/ShockAlarmApp-Setup.exe windows/$installerName | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ShockAlarmApp-WindowsSetup | |
| path: windows/${{ steps.rename.outputs.installerName }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ShockAlarmApp-WindowsPortable | |
| path: build\windows\x64\runner\Release\ | |
| - name: Compress zip | |
| run: | | |
| Compress-Archive -Path build\windows\x64\runner\Release\* -DestinationPath ShockAlarmApp.Windows.Portable.${{steps.rename.outputs.buildName}}.zip | |
| - name: Upload to GitHub release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: windows/${{ 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: ShockAlarmApp.Windows.Portable.${{steps.rename.outputs.buildName}}.zip |