Skip to content

Bump version to 1.1.0 - macOS platform support #22

Bump version to 1.1.0 - macOS platform support

Bump version to 1.1.0 - macOS platform support #22

Workflow file for this run

name: build test and commit
on:
push:
branches: [ master, dev ]
tags:
- 'v*.*.*'
pull_request:
branches: [ master ]
jobs:
build-linux-gnu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [AMD64, i386, arm, aarch64]
include:
- name: i386
platformflags: -m32
- name: arm
platformtools: arm-linux-gnueabi
emulator: qemu-arm
- name: aarch64
platformtools: aarch64-linux-gnu
emulator: qemu-aarch64
# name: build-linux-gnu (${{matrix.name}})
env:
PLATFORMFLAGS: ${{matrix.platformflags}}
PLATFORM_PREFIX: ${{matrix.platformtools}}
EMULATOR: ${{matrix.emulator}}
steps:
- uses: actions/checkout@v4
- name: install multilib
run: sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
if: ${{ matrix.name == 'i386' }}
- name: install qemu
if: matrix.emulator
run: sudo apt-get install --no-install-recommends -y qemu-user
- name: install abi lib
if: matrix.platformtools
run: sudo apt-get install --no-install-recommends -y gcc-${{matrix.platformtools}} g++-${{matrix.platformtools}}
- name: make
run: make all
- name: test
run: make test
- name: set abi name
run: echo abiname=$(make abiname) >> $GITHUB_ENV
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.abiname }}
path: lib/${{ env.abiname }}/libstackman.a
build-macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-latest]
include:
- os: macos-15-intel
abi: darwin_x86_64
- os: macos-latest
abi: darwin_arm64
steps:
- uses: actions/checkout@v4
- name: Build library
run: make all
- name: Run tests
run: make test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.abi }}
path: lib/${{ matrix.abi }}/libstackman.a
build-windows:
runs-on: windows-latest
strategy:
matrix:
platform: [x86, x64, arm64]
include:
- platform: x86
folder: Win32
native: yes
- platform: x64
folder: x64
native: yes
- platform: arm64
folder: arm64
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: build
run: msbuild.exe vs2022\stackman.sln /p:Platform=${{matrix.platform}}
- name: strip timestamps from lib
run: python tools/strip-lib.py lib/win_${{matrix.platform}}/stackman.lib
- name: rebuild after stripping
run: msbuild.exe vs2022\stackman.sln /p:Platform=${{matrix.platform}}
- name: test
if: ${{ matrix.native == 'yes' }}
run: vs2022\${{matrix.folder}}\Debug\test.exe
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: win_${{ matrix.platform }}
path: lib/win_${{matrix.platform}}/stackman.lib
commit-artifacts:
runs-on: ubuntu-latest
needs: [build-linux-gnu, build-macos, build-windows]
if: false # Disabled - libraries no longer committed to repository
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: lib
- name: Commit changes
run: |
git config --global user.name 'Automation tool'
git config --global user.email 'automation-tool@users.noreply.github.com'
git add lib/*.a lib/*.lib
git status
git diff-index --quiet HEAD || git commit -m "Automated build"
git push
create-release:
runs-on: ubuntu-latest
needs: [build-linux-gnu, build-macos, build-windows]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release archive
run: |
mkdir -p release/lib
# Copy libraries maintaining the lib/{abi}/ structure
cp -r artifacts/sysv_amd64 release/lib/
cp -r artifacts/sysv_i386 release/lib/
cp -r artifacts/arm32 release/lib/
cp -r artifacts/aarch64 release/lib/
cp -r artifacts/darwin_x86_64 release/lib/
cp -r artifacts/darwin_arm64 release/lib/
cp -r artifacts/win_x86 release/lib/
cp -r artifacts/win_x64 release/lib/
cp -r artifacts/win_arm64 release/lib/
# Copy headers, tools, and documentation
cp -r stackman release/
cp -r tools release/
cp Makefile README.md LICENSE CHANGELOG.md release/
# Create version-specific archive
VERSION=${GITHUB_REF#refs/tags/v}
cd release
tar -czf ../stackman-${VERSION}.tar.gz .
cd ..
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: stackman-${{ steps.get_version.outputs.VERSION }}.tar.gz
body: |
See [CHANGELOG.md](https://github.com/stackless-dev/stackman/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
## Download
Download `stackman-${{ steps.get_version.outputs.VERSION }}.tar.gz` containing pre-built libraries for all platforms.
## Contents
```
stackman/ - Header files
lib/
sysv_amd64/ - Linux x86_64
sysv_i386/ - Linux x86 (32-bit)
arm32/ - Linux ARM (32-bit, AAPCS)
aarch64/ - Linux ARM64 (AAPCS64)
darwin_x86_64/ - macOS x86_64 (Intel)
darwin_arm64/ - macOS ARM64 (Apple Silicon)
win_x86/ - Windows x86 (32-bit)
win_x64/ - Windows x64
win_arm64/ - Windows ARM64
README.md
LICENSE
CHANGELOG.md
```
## Usage
```bash
# Extract
tar -xzf stackman-${{ steps.get_version.outputs.VERSION }}.tar.gz
# Build detects platform automatically
make abiname # Shows detected ABI (e.g., sysv_amd64)
# Link with your project
gcc -Istackman mycode.c -Llib/sysv_amd64 -lstackman
# Or let Makefile auto-detect
ABI=$(shell make -C stackman-${{ steps.get_version.outputs.VERSION }} abiname)
gcc -Istackman mycode.c -Llib/$(ABI) -lstackman
```