Simplify release process with GitHub Release action #15
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: Windows build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout main repository | |
| uses: actions/checkout@v4 | |
| - name: Clone skMHL-avs dependency | |
| run: | | |
| git clone https://github.com/shadowlmd/skMHL-avs.git | |
| - name: Cache FreePascal | |
| uses: actions/cache@v3 | |
| with: | |
| path: C:\FPC\3.2.2 | |
| key: fpc-3.2.2 | |
| - name: Download and install FreePascal | |
| shell: powershell | |
| run: | | |
| if (!(Test-Path "C:\FPC\3.2.2\bin\i386-win32\fpc.exe")) { | |
| $url = "http://downloads.freepascal.org/fpc/dist/3.2.2/i386-win32/fpc-3.2.2.i386-win32.exe" | |
| Invoke-WebRequest -Uri $url -OutFile fpc-installer.exe | |
| Start-Process -FilePath .\fpc-installer.exe -ArgumentList '/VERYSILENT' -Wait | |
| } | |
| - name: Build mbtool.exe | |
| shell: cmd | |
| run: | | |
| mkdir release | |
| C:\FPC\3.2.2\bin\i386-win32\fpc.exe -B -dRELEASE ^ | |
| -Flrelease ^ | |
| -FUrelease ^ | |
| -FuskMHL-avs\sources ^ | |
| -FiskMHL-avs\sources ^ | |
| -g -gl ^ | |
| mbtool.pas | |
| - name: Create ZIP archive | |
| shell: powershell | |
| run: | | |
| Compress-Archive -Path mbtool.exe -DestinationPath mbtool-windows.zip | |
| - name: GitHub Release | |
| uses: johnwbyrd/update-release@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| release: latest | |
| tag: latest | |
| files: mbtool-windows.zip |