Skip to content

build: fix workflow #19

build: fix workflow

build: fix workflow #19

Workflow file for this run

name: Build and Release Tahini Binaries
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '21'
- name: Build jar with Gradle
run: |
cd tahini
./gradlew build
- name: Compile native image
run: |
cd tahini
native-image -jar app/build/libs/app.jar tahini
- name: Rename binary for unique names on Macos and Linux
if: matrix.os != 'windows-latest'
run: |
cd tahini
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
mv tahini tahini-linux
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
mv tahini tahini-macos
fi
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: tahini-${{ matrix.os }}
path: tahini
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all binaries
uses: actions/download-artifact@v4
with:
path: .
- name: List files
run: |
echo "Listing files in current directory:"
ls -l
check_directory() {
local dir=$1
local file=$2
if [ -d "$dir" ]; then
echo "$dir directory exists."
if [ -f "$dir/$file" ]; then
echo "$file exists in $dir."
else
echo "$file does not exist in $dir. Listing files in $dir:"
ls -l "$dir"
fi
else
echo "$dir directory does not exist."
fi
}
check_directory "tahini-ubuntu-latest" "tahini"
check_directory "tahini-ubuntu-latest" "tahini-linux"
check_directory "tahini-macos-latest" "tahini"
check_directory "tahini-macos-latest" "tahini-macos"
check_directory "tahini-windows-latest" "tahini.exe"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
tahini-ubuntu-latest/tahini-macos
tahini-macos-latest/tahini-linux
tahini-windows-latest/tahini.exe
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}