release #1227
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: release | |
on: | |
create: | |
tags: | |
- '*' | |
jobs: | |
create_binaries: | |
if: (github.event_name == 'create' && github.event.ref_type == 'tag') | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Set up JDK' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 21 | |
- name: 'Prepare branch name' | |
run: > | |
echo "refName=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: 'Checkout relevant branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.refName }} | |
- name: 'Cache Maven packages' | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}-${{ github.sha }} | |
- name: 'Create distribution' | |
run: > | |
./mvnw --no-transfer-progress -DskipTests -pl eu.michael-simons.neo4j:neo4j-migrations-cli -am package | |
- name: 'Upload build artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-jvm | |
path: neo4j-migrations-cli/target/neo4j-migrations*.zip | |
create_native_binaries: | |
if: (github.event_name == 'create' && github.event.ref_type == 'tag') | |
name: 'Build with Graal on ${{ matrix.os }}' | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: 'Prepare git' | |
run: git config --global core.autocrlf false | |
- name: 'Prepare branch name' | |
run: > | |
echo "refName=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: 'Checkout relevant branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.refName }} | |
- name: 'Set up Graal' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
distribution: 'graalvm-community' | |
java-version: 23 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Create distribution' | |
run: > | |
./mvnw --no-transfer-progress -Pnative -DskipTests -pl eu.michael-simons.neo4j:neo4j-migrations-cli package -am | |
- name: 'Smoke test' | |
run: > | |
./neo4j-migrations-cli/target/neo4j-migrations -V | |
- name: 'Upload build artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-${{ matrix.os }} | |
path: | | |
neo4j-migrations-cli/target/neo4j-migrations*.zip | |
!neo4j-migrations-cli/target/neo4j-migrations-${{ env.refName }}.zip | |
release: | |
if: (github.event_name == 'create' && github.event.ref_type == 'tag') | |
needs: [ create_binaries, create_native_binaries ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Prepare branch name' | |
run: > | |
echo "refName=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: 'Checkout relevant branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.refName }} | |
fetch-depth: 0 | |
- name: 'Download all build artifacts' | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: artifacts-* | |
path: neo4j-migrations-cli/target | |
merge-multiple: true | |
- name: 'Restore Maven packages' | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: 'Create release' | |
env: | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }} | |
JRELEASER_SDKMAN_CONSUMER_KEY: ${{ secrets.JRELEASER_SDKMAN_CONSUMER_KEY }} | |
JRELEASER_SDKMAN_CONSUMER_TOKEN: ${{ secrets.JRELEASER_SDKMAN_CONSUMER_TOKEN }} | |
run: ./mvnw --no-transfer-progress -Pjreleaser -pl :neo4j-migrations-parent jreleaser:full-release |