Skip to content

update native-image search #7

update native-image search

update native-image search #7

name: CI Build and Release
on:
push:
branches:
- main
- test-ci-pipeline
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [amd64, arm64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
architecture: ${{ matrix.arch }}
- name: Install Clojure CLI and Babashka
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'
- name: Run CI Task
run: clojure -T:build ci
- name: Archive build artifact
uses: actions/upload-artifact@v2
with:
name: clj-mergetool-${{ matrix.os }}-${{ matrix.arch }}
path: target/clj-mergetool${{ matrix.os == 'windows-latest' && '.exe' || '' }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts for Linux amd64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-ubuntu-latest-amd64
path: target/clj-mergetool-linux-amd64
- name: Download build artifacts for Linux arm64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-ubuntu-latest-arm64
path: target/clj-mergetool-linux-arm64
- name: Download build artifacts for Windows amd64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-windows-latest-amd64.exe
path: target/clj-mergetool-windows-amd64.exe
- name: Download build artifacts for Windows arm64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-windows-latest-arm64.exe
path: target/clj-mergetool-windows-arm64.exe
- name: Download build artifacts for macOS amd64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-macos-latest-amd64
path: target/clj-mergetool-macos-amd64
- name: Download build artifacts for macOS arm64
uses: actions/download-artifact@v2
with:
name: clj-mergetool-macos-latest-arm64
path: target/clj-mergetool-macos-arm64
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
architecture: ${{ matrix.arch }}
- name: Install Clojure CLI and Babashka
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'
- name: Run Release Version Task
if: github.ref == 'refs/heads/main'
run: clojure -T:build release-version
- name: Push changes
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git push origin main
- name: Create Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
files: |
target/clj-mergetool-linux-amd64
target/clj-mergetool-linux-arm64
target/clj-mergetool-windows-amd64.exe
target/clj-mergetool-windows-arm64.exe
target/clj-mergetool-macos-amd64
target/clj-mergetool-macos-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}