Skip to content

fix(scripts): use script's directory for git commands in download-lib… #7

fix(scripts): use script's directory for git commands in download-lib…

fix(scripts): use script's directory for git commands in download-lib… #7

Workflow file for this run

name: "release-libs"
on:
push:
workflow_dispatch:
jobs:
build-linux:
strategy:
matrix:
include:
- arch: "amd64"
runner: "ubuntu-24.04"
- arch: "arm64"
runner: "ubuntu-24.04-arm"
runs-on: "${{ matrix.runner }}"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"
- name: "Build library"
run: |
DOCKER_ENV="-e HOST_UID=$(id -u) -e HOST_GID=$(id -g)"
docker build -t clp-ffi-go-builder .
docker run --rm $DOCKER_ENV -v ${{ github.workspace }}/pre-built:/output clp-ffi-go-builder
- name: "Upload artifact"
uses: "actions/upload-artifact@v4"
with:
name: "libclp-ffi-go_linux_${{ matrix.arch }}"
path: "pre-built/lib/libclp-ffi-go_linux_${{ matrix.arch }}.a"
release:
needs: "build-linux"
runs-on: "ubuntu-24.04"
permissions:
contents: write
steps:
- uses: "actions/checkout@v4"
- name: "Download all artifacts"
uses: "actions/download-artifact@v4"
with:
path: "artifacts"
- name: "Get short commit hash"
id: "commit"
run: echo "hash=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: "Create tag"
run: |
git tag "${{ steps.commit.outputs.hash }}"
git push origin "${{ steps.commit.outputs.hash }}"
- name: "Create release"
env:
GH_TOKEN: "${{ github.token }}"
run: |
gh release create "${{ steps.commit.outputs.hash }}" \
--title "Build ${{ steps.commit.outputs.hash }}" \
--notes "Pre-built native libraries for commit ${{ steps.commit.outputs.hash }}" \
artifacts/**/*.a