Skip to content

sched: TRACE_EXEC separate from TRACE_MEMORY #36

sched: TRACE_EXEC separate from TRACE_MEMORY

sched: TRACE_EXEC separate from TRACE_MEMORY #36

Workflow file for this run

# Builds rsm either when a version tag is created or source is changed.
#
# When a version tag is created, a release is automatically created.
#
# Otherwise, when source changes without a tag being created,
# the build artifacts are uploaded to github and saved for 1 day.
# They can be found at https://github.com/rsms/rsm/actions/runs/RUNID
name: Build rsm
on:
push:
branches: ["main"]
paths:
- "src/**"
- build.sh
tags:
- "v*"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
fail-fast: false
matrix:
target:
- x86_64-linux-musl
- i386-linux-musl
- aarch64-linux-musl
- riscv64-linux-musl
- riscv64-linux-musl
- x86_64-macos-gnu
- aarch64-macos-gnu
#- x86_64-windows-gnu
name: ${{ matrix.target }}
env:
prerelease: false
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install ninja
run: sudo apt-get install -y ninja-build
- name: Install zig
run: |
curl -L https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJ
- name: Define version (tag)
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${{ github.ref }}
VERSION=${VERSION:11} # refs/tags/v1.2.3 => 1.2.3
echo "rsm_version=$VERSION" >> $GITHUB_ENV
- name: Define version (branch)
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
run: |
VERSION=${{ github.sha }}
echo "rsm_version=${VERSION:0:10}" >> $GITHUB_ENV
- name: Build rsm
run: |
CFLAGS_HOST="-target ${{ matrix.target }}" \
LDFLAGS_HOST="-target ${{ matrix.target }}" \
CC="$PWD/zig-linux-x86_64-0.9.1/zig cc" \
bash build.sh -static -out=out-${{ matrix.target }} "$@"
- name: Create archive
run: |
# TARGET = os-arch
TARGET=$(echo "${{ matrix.target }}" | cut -d- -f2)
TARGET=$TARGET-$(echo "${{ matrix.target }}" | cut -d- -f1)
NAME=rsm-$TARGET-${{ env.rsm_version }}
ARCHIVE=$NAME.tar.gz
echo "rsm_archive=$ARCHIVE" >> $GITHUB_ENV
mkdir $NAME
mv out-${{ matrix.target }}/rsm $NAME/
tar -czvf "$ARCHIVE" "$NAME"
- name: Upload archive (unless tag)
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: "${{ env.rsm_archive }}"
path: "${{ env.rsm_archive }}"
retention-days: 1
- name: Publish release (if tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
name: "rsm ${{ env.rsm_version }}"
body: "rsm ${{ env.rsm_version }} built from ${{ github.sha }}"
files: "${{ env.rsm_archive }}"