release #91
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: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| macos_smoke: | |
| uses: ./.github/workflows/mac_smoke_test.yml | |
| build: | |
| needs: macos_smoke | |
| name: build-${{ matrix.os }}-${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: linux | |
| arch: amd64 | |
| runner: ubuntu-22.04 | |
| - os: macos | |
| arch: amd64 | |
| runner: macos-15-intel | |
| - os: macos | |
| arch: arm64 | |
| runner: macos-latest | |
| - os: windows | |
| arch: amd64 | |
| runner: windows-latest | |
| defaults: | |
| run: | |
| working-directory: . | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25.0" | |
| check-latest: true | |
| - name: Verify Go toolchain | |
| run: | | |
| which go | |
| go version | |
| - name: Install LLVM toolchain (macos) | |
| if: matrix.os == 'macos' | |
| run: | | |
| brew install llvm lld | |
| LLVM_BIN="$(brew --prefix llvm)/bin" | |
| LLD_BIN="$(brew --prefix lld)/bin" | |
| echo "FERRET_LLVM_BIN=$LLVM_BIN" >> "$GITHUB_ENV" | |
| echo "FERRET_LLD_BIN=$LLD_BIN" >> "$GITHUB_ENV" | |
| echo "$LLVM_BIN" >> "$GITHUB_PATH" | |
| echo "$LLD_BIN" >> "$GITHUB_PATH" | |
| - name: Verify macOS clang source | |
| if: matrix.os == 'macos' | |
| run: | | |
| export PATH="$FERRET_LLVM_BIN:$FERRET_LLD_BIN:$PATH" | |
| which clang | |
| clang --version | |
| which ld64.lld | |
| ld64.lld --version | |
| - name: Install LLVM toolchain (linux) | |
| if: matrix.os == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget gnupg ca-certificates lsb-release | |
| wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh | |
| chmod +x /tmp/llvm.sh | |
| sudo /tmp/llvm.sh 18 | |
| sudo apt-get install -y clang-18 lld-18 gcc-multilib libc6-dev-i386 | |
| mkdir -p "$HOME/.local/llvm-bin" | |
| ln -sf /usr/bin/clang-18 "$HOME/.local/llvm-bin/clang" | |
| ln -sf /usr/bin/clang++-18 "$HOME/.local/llvm-bin/clang++" | |
| ln -sf /usr/bin/lld-18 "$HOME/.local/llvm-bin/lld" | |
| ln -sf /usr/bin/ld.lld-18 "$HOME/.local/llvm-bin/ld.lld" | |
| echo "$HOME/.local/llvm-bin" >> "$GITHUB_PATH" | |
| - name: Verify Linux clang version | |
| if: matrix.os == 'linux' | |
| run: | | |
| clang --version | |
| ld.lld --version | |
| - name: Setup MSYS2 toolchain | |
| if: matrix.os == 'windows' | |
| id: msys2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-binutils | |
| mingw-w64-x86_64-clang | |
| mingw-w64-x86_64-lld | |
| mingw-w64-i686-toolchain | |
| - name: Add MSYS2 to PATH | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| "${{ steps.msys2.outputs.msys2-location }}\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| - name: Verify Windows clang source | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| Get-Command clang | Format-List Source | |
| clang --version | |
| - name: Pack bundle (unix) | |
| if: matrix.os != 'windows' | |
| run: | | |
| if [ "${{ matrix.os }}" = "macos" ]; then | |
| export PATH="$FERRET_LLVM_BIN:$FERRET_LLD_BIN:$PATH" | |
| fi | |
| rm -rf build dist | |
| go run ./bundler | |
| - name: Pack bundle (windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| Remove-Item -Recurse -Force build, dist -ErrorAction SilentlyContinue | |
| go run ./bundler | |
| - name: Verify core bundle (unix) | |
| if: matrix.os != 'windows' | |
| run: | | |
| test -f build/core/bin/ferret | |
| - name: Verify core bundle (windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| if (!(Test-Path "build\core\bin\ferret.exe")) { | |
| throw "core ferret.exe not found" | |
| } | |
| - name: Verify toolchain bundle (unix) | |
| if: matrix.os != 'windows' | |
| run: | | |
| if [ "${{ matrix.os }}" = "macos" ]; then | |
| export PATH="$FERRET_LLVM_BIN:$FERRET_LLD_BIN:$PATH" | |
| fi | |
| test -f build/toolchain/bin/clang | |
| - name: Verify macOS toolchain bundle | |
| if: matrix.os == 'macos' | |
| run: | | |
| test -f build/toolchain/bin/ld64.lld | |
| - name: Verify toolchain bundle (windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| if (!(Test-Path "build\toolchain\bin\clang.exe")) { | |
| throw "toolchain clang.exe not found" | |
| } | |
| if (!(Test-Path "build\toolchain\bin\ld.lld.exe")) { | |
| throw "toolchain ld.lld.exe not found" | |
| } | |
| if (!(Test-Path "build\toolchain\bin\lld-link.exe")) { | |
| throw "toolchain lld-link.exe not found" | |
| } | |
| if (!(Test-Path "build\toolchain\lib32")) { | |
| throw "toolchain lib32 not found" | |
| } | |
| & "build\toolchain\bin\ld.lld.exe" --version | |
| & "build\toolchain\bin\lld-link.exe" --version | |
| - name: Packaged LLVM smoke (windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| & "build\core\bin\ferret.exe" -backend llvm -o "build\smoke.exe" "tests\semma\string_realworld_ok.fer" | |
| if (!(Test-Path "build\smoke.exe")) { | |
| throw "packaged windows llvm smoke output not found" | |
| } | |
| & "build\core\bin\ferret.exe" -m32 -backend llvm -o "build\smoke32.exe" "tests\semma\string_realworld_ok.fer" | |
| if (!(Test-Path "build\smoke32.exe")) { | |
| throw "packaged windows llvm 32-bit smoke output not found" | |
| } | |
| - name: Archive (unix) | |
| if: matrix.os != 'windows' | |
| run: | | |
| mkdir -p dist | |
| tar -czf "dist/ferret-${{ matrix.os }}-${{ matrix.arch }}.tar.gz" -C build/core . | |
| tar -czf "dist/ferret-toolchain-${{ matrix.os }}-${{ matrix.arch }}.tar.gz" -C build/toolchain . | |
| - name: Archive (windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| Compress-Archive -Path "build\core\*" -DestinationPath "dist\ferret-${{ matrix.os }}-${{ matrix.arch }}.zip" | |
| Compress-Archive -Path "build\toolchain\*" -DestinationPath "dist\ferret-toolchain-${{ matrix.os }}-${{ matrix.arch }}.zip" | |
| - name: Install Inno Setup | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| choco install innosetup --no-progress -y | |
| - name: Build Windows installer | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "installers\ferret-installer.iss" | |
| $setupPath = "installers\dist\FerretSetup.exe" | |
| if (!(Test-Path $setupPath)) { | |
| throw "Windows installer output not found at $setupPath" | |
| } | |
| Copy-Item -Force $setupPath "dist\FerretSetup-${{ matrix.os }}-${{ matrix.arch }}.exe" | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferret-${{ matrix.os }}-${{ matrix.arch }} | |
| path: | | |
| dist/ferret-${{ matrix.os }}-${{ matrix.arch }}.tar.gz | |
| dist/ferret-${{ matrix.os }}-${{ matrix.arch }}.zip | |
| dist/ferret-toolchain-${{ matrix.os }}-${{ matrix.arch }}.tar.gz | |
| dist/ferret-toolchain-${{ matrix.os }}-${{ matrix.arch }}.zip | |
| dist/FerretSetup-${{ matrix.os }}-${{ matrix.arch }}.exe | |
| if-no-files-found: ignore | |
| publish: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: ferret-* | |
| merge-multiple: true | |
| - name: Publish release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| overwrite_files: true | |
| make_latest: true |