cmake: scala specific stuff #11
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: Build and Release | |
on: | |
push: {} | |
pull_request: {} | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.x' | |
- name: Install cross-compilation dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
gcc \ | |
clang \ | |
clang-tools \ | |
g++-mingw-w64-x86-64 \ | |
gcc-mingw-w64-x86-64 \ | |
gcc-riscv64-linux-gnu \ | |
g++-riscv64-linux-gnu \ | |
gcc-aarch64-linux-gnu \ | |
g++-aarch64-linux-gnu \ | |
wget \ | |
tar \ | |
xz-utils \ | |
software-properties-common \ | |
aria2 | |
- name: Install FreeBSD sysroot | |
run: | | |
sudo mkdir -p /usr/local/freebsd-sysroot | |
aria2c -x 4 https://download.freebsd.org/ftp/releases/amd64/13.4-RELEASE/base.txz | |
sudo tar -xJf base.txz -C /usr/local/freebsd-sysroot | |
rm base.txz | |
- name: Install osxcross for Darwin builds | |
run: | | |
sudo apt-get install -y \ | |
clang \ | |
cmake \ | |
libxml2-dev \ | |
uuid-dev \ | |
libssl-dev \ | |
zlib1g-dev \ | |
libbz2-dev \ | |
liblzma-dev | |
git clone https://github.com/tpoechtrager/osxcross.git | |
cd osxcross | |
wget -nc https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz | |
mv MacOSX11.3.sdk.tar.xz tarballs/ | |
UNATTENDED=1 ./build.sh | |
echo "$(pwd)/target/bin" >> $GITHUB_PATH | |
- name: Run make | |
run: make | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-binaries | |
path: bin/ | |
retention-days: 5 | |
- name: Get tag version (if tag push) | |
if: startsWith(github.ref, 'refs/tags/') | |
id: get_version | |
run: | | |
TAG_VERSION=${GITHUB_REF#refs/tags/} | |
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT | |
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: [build] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: built-binaries | |
path: bin | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ needs.build.outputs.tag_version }} | |
name: Release ${{ needs.build.outputs.tag_version }} | |
body: | | |
## Pre-built binaries | |
- Static libraries (.a files) | |
- Header files (.h files) | |
Built from tag: ${{ needs.build.outputs.tag_version }} | |
files: | | |
bin/*.a | |
bin/*.h | |
generate_release_notes: true | |
draft: false | |
prerelease: false |