Skip to content

pkg(ghc-cross): Enable iserv build #83

pkg(ghc-cross): Enable iserv build

pkg(ghc-cross): Enable iserv build #83

Workflow file for this run

name: build
on:
push:
tags:
- ghc-v[0-9]+.[0-9]+.[0-9]+
pull_request:
paths:
- "packages/**"
workflow_dispatch:
inputs:
release_tag:
description: Tag to be used for github release
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
strategy:
matrix:
target_arch: [aarch64, arm, x86_64, i686]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
- name: Build
run: |
mkdir ./out-dir
# Process tag '%ci:no-build' that may be added as line to commit message.
# Forces CI to cancel current build with status 'passed'.
if grep -qiP '^\s*%ci:no-build\s*$' <(git log --format="%B" -n 1 "HEAD"); then
echo "[!] Force exiting as tag '%ci:no-build' was applied to HEAD commit message."
touch ./out-dir/placeholder.zip
exit 0
fi
./free-space.sh
./run-docker.sh \
./compile.sh ./out-dir ${{ matrix.target_arch }}
- name: Store files
uses: actions/upload-artifact@v4
with:
name: ghc-${{ matrix.target_arch }}
path: ./out-dir/*
create-release:
if: github.event_name != 'pull_request'
needs:
- build
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
# Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v4
- name: Get files
uses: actions/download-artifact@v4
- name: Create new release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prerelease=""
release_tag="${GITHUB_REF#refs/*/}"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
release_tag="${{ github.event.inputs.release_tag }}"
fi
if [[ "${release_tag/+test/}" != "$release_tag" ]]; then
prerelease="--prerelease"
fi
if gh release view "$release_tag"; then
echo "Updating release '$release_tag' ..."
gh release upload "$release_tag" ./ghc-*/*.xz --clobber
else
echo "Creating release '$release_tag' ..."
gh release create "$release_tag" ./ghc-*/*.xz $prerelease
fi