Fix difficulty fork so pre-fork blocks still validate (v2.3.1) #38
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: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-26-intel, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install system dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install openssl@3 | |
| - name: Build the standalone executables | |
| run: python tools/build_release.py | |
| - name: Compile the Windows installer | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $version = (Get-Content src\scarletcoin\__init__.py | | |
| Select-String '__version__ = "([^"]+)"' | Select-Object -First 1 | |
| ).Matches[0].Groups[1].Value | |
| # GitHub runners ship Inno Setup; fall back to a direct download of | |
| # the installer only when it is missing. jrsoftware.org/download.php | |
| # serves an HTML page, not the installer, so it must not be used. | |
| $candidates = @( | |
| "$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe", | |
| "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe", | |
| "$env:ProgramFiles\Inno Setup 6\ISCC.exe" | |
| ) | |
| $iscc = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1 | |
| if (-not $iscc) { | |
| Write-Host "Inno Setup is not pre-installed; downloading it..." | |
| $installer = "$env:RUNNER_TEMP\innosetup.exe" | |
| Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/releases/download/is-6_7_3/innosetup-6.7.3.exe" -OutFile $installer | |
| if ((Get-Item $installer).Length -lt 1MB) { | |
| throw "Inno Setup download looks wrong: $((Get-Item $installer).Length) bytes" | |
| } | |
| Start-Process $installer -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/SP-", "/CURRENTUSER" -Wait | |
| $iscc = "$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe" | |
| if (-not (Test-Path $iscc)) { | |
| throw "Inno Setup installed but ISCC.exe was not found" | |
| } | |
| } | |
| Write-Host "Compiling the installer with $iscc" | |
| & $iscc /DMyAppVersion=$version packaging\windows\scarletcoin.iss | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "ISCC failed with exit code $LASTEXITCODE" | |
| } | |
| - name: Upload the release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scarletcoin-${{ matrix.os }} | |
| path: | | |
| release/*.zip | |
| release/*.tar.gz | |
| release/*.exe | |
| if-no-files-found: error | |
| build-fedora: | |
| name: Build (Fedora 44) | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:44 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install the build and runtime dependencies | |
| run: | | |
| dnf -y install \ | |
| python3 python3-pip binutils \ | |
| libxkbcommon libxkbcommon-x11 \ | |
| glib2 libicu fontconfig freetype harfbuzz \ | |
| libX11 libXext libXrender libXi libXrandr libXcursor libXinerama \ | |
| libXcomposite libXdamage libXfixes libxcb xcb-util xcb-util-wm \ | |
| xcb-util-keysyms xcb-util-image xcb-util-renderutil \ | |
| mesa-libGL mesa-libEGL libglvnd \ | |
| libpng libjpeg-turbo libzstd xz \ | |
| xkeyboard-config | |
| - name: Build the standalone executables | |
| run: python3 tools/build_release.py | |
| - name: Name the archive for the Fedora build | |
| run: | | |
| archive=$(ls release/ScarletCoin-*-linux-x86_64.tar.gz) | |
| mv "$archive" "${archive/linux-x86_64/linux-fc44-x86_64}" | |
| - name: Upload the release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scarletcoin-fedora | |
| path: release/*.tar.gz | |
| if-no-files-found: error | |
| publish: | |
| name: Publish the GitHub release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |