Dev Build and Upload Yaci CLI Zip #4
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: Dev Build and Upload Yaci CLI Zip | |
#on: | |
# push: | |
# tags: | |
# - 'rel-dev-*' | |
on: | |
workflow_dispatch: | |
jobs: | |
buildAndPush: | |
strategy: | |
matrix: | |
os: ["ubuntu-20.04", "macos-14"] | |
runs-on: ${{ matrix.os }} | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
FORCE_COLOR: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
version: '23.0.1' | |
native-image-job-reports: 'true' | |
- name: Get Tag from version file | |
run: | | |
TAG=$(grep "tag=" config/version | cut -d'=' -f2) | |
echo "TAG=${TAG}" >> $GITHUB_ENV | |
- name: Grant execute permission for gradlew | |
working-directory: applications/cli | |
run: chmod +x gradlew | |
- name: Copy CI specific native-image properties | |
working-directory: applications/cli | |
if: runner.os == 'Linux' | |
run: | | |
echo "os_prefix=linux" >> $GITHUB_ENV | |
- name: MacOS specific env | |
if: runner.os == 'macOS' | |
run: | | |
echo "os_prefix=macos" >> $GITHUB_ENV | |
- name: Set lowercase architecture | |
run: echo "arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Build with Gradle | |
working-directory: applications/cli | |
run: ./gradlew --no-daemon -i -Pversion=${{ env.TAG }} clean build nativeCompile cliZip | |
- name: Copy artifacts | |
working-directory: applications/cli | |
run: mv build/yaci-cli-${{ env.TAG }}.zip build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }} | |
path: ./applications/cli/build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip |