Skip to content

feat: Update swift-toml to 2.0.0 with improved error reporting (#55) #34

feat: Update swift-toml to 2.0.0 with improved error reporting (#55)

feat: Update swift-toml to 2.0.0 with improved error reporting (#55) #34

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: macos-15
platform: macos-arm64
arch: arm64
build-path: arm64-apple-macosx/release
- os: ubuntu-latest
platform: linux-x64
arch: x86_64
build-path: x86_64-unknown-linux-gnu/release
container: swift:6.1-jammy
extra-flags: --static-swift-stdlib -Xlinker -lstdc++ -Xlinker -L/usr/lib/swift/linux
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Install dependencies (Linux)
if: matrix.platform == 'linux-x64'
run: apt-get update && apt-get install -y curl build-essential
- uses: actions/checkout@v6
- name: Cache SPM packages
uses: actions/cache@v5
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Select Xcode 16 (macOS)
if: matrix.platform == 'macos-arm64'
run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
- name: Replace version placeholder
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
if [ "${{ matrix.platform }}" = "macos-arm64" ]; then
sed -i '' "s/VERSION_PLACEHOLDER/$VERSION/g" Sources/main.swift
else
sed -i "s/VERSION_PLACEHOLDER/$VERSION/g" Sources/main.swift
fi
- name: Build release binary
run: swift build -c release --arch ${{ matrix.arch }} ${{ matrix.extra-flags }}
- name: Create release archive
run: |
tar -czf xcsift-${{ github.ref_name }}-${{ matrix.platform }}.tar.gz \
-C .build/${{ matrix.build-path }} xcsift
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: xcsift-${{ matrix.platform }}
path: xcsift-${{ github.ref_name }}-${{ matrix.platform }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*/xcsift-*.tar.gz
generate_release_notes: true