Skip to content

chore: release main (#436) #24

chore: release main (#436)

chore: release main (#436) #24

Workflow file for this run

on:
push:
tags:
- 'accesskit_c-v*'
name: Publish C bindings
jobs:
build-binaries:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macOS-latest
target: aarch64-apple-darwin
cmake-options: -DCMAKE_OSX_ARCHITECTURES=arm64
path: macos/arm64
- os: macOS-latest
target: x86_64-apple-darwin
cmake-options: -DCMAKE_OSX_ARCHITECTURES=x86_64
path: macos/x86_64
- os: windows-2019
target: aarch64-pc-windows-msvc
setup-step: 'cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat" `& powershell'
cmake-options: -A ARM64
path: windows/arm64/msvc
- os: windows-2019
target: i686-pc-windows-msvc
setup-step: 'cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" `& powershell'
cmake-options: -A Win32
path: windows/x86/msvc
- os: windows-2019
target: x86_64-pc-windows-msvc
setup-step: 'cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" `& powershell'
path: windows/x86_64/msvc
- os: ubuntu-latest
target: i686-pc-windows-gnu
setup-step: sudo apt update && sudo apt install -y mingw-w64
cmake-options: -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86 -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++
path: windows/x86/mingw
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
setup-step: sudo apt update && sudo apt install -y mingw-w64
cmake-options: -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
path: windows/x86_64/mingw
- os: ubuntu-latest
target: i686-unknown-linux-gnu
setup-step: sudo apt update && sudo apt install -y gcc-multilib g++-multilib
cmake-options: -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86
path: linux/x86
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
path: linux/x86_64
name: Build
steps:
- uses: actions/checkout@v4
- name: install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
- name: build libraries
run: |
${{ matrix.setup-step || '' }}
cmake -S bindings/c -B build -DRust_CARGO_TARGET=${{ matrix.target }} ${{ matrix.cmake-options || '' }} ${{ !contains(matrix.target, 'msvc') && '-DCMAKE_BUILD_TYPE=Release' || '' }}
cmake --build build ${{ contains(matrix.target, 'msvc') && '--config Release' || '' }}
cmake --install build ${{ contains(matrix.target, 'msvc') && '--config Release' || '' }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: bindings/c/lib
publish:
needs: [build-binaries]
runs-on: ubuntu-latest
name: Publish
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
path: artifacts
- run: |
mkdir -p accesskit_c/lib
cp -r artifacts/*/* accesskit_c/lib
cp -r bindings/c/examples bindings/c/include accesskit_c/
cp bindings/c/accesskit*.cmake accesskit_c/
cp bindings/c/*.md accesskit_c/
cp LICENSE* accesskit_c/
mv accesskit_c ${{ github.ref_name }}
zip -r ${{ github.ref_name }}.zip ${{ github.ref_name }}
- uses: AButler/upload-release-assets@v2.0
with:
files: ${{ github.ref_name }}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }}