Skip to content

release

release #1043

Workflow file for this run

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@v3
with:
distribution: zulu
java-version: 21
- name: 'Prepare branch name'
run: >
echo "refName=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: 'Checkout relevant branch'
uses: actions/checkout@v3
with:
ref: ${{ env.refName }}
- name: 'Cache Maven packages'
uses: actions/cache@v3
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@v2
with:
name: artifacts
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@v3
with:
ref: ${{ env.refName }}
- name: Install upx
run: sudo apt-get install upx
if: ${{ runner.os == 'Linux' }}
- name: Install upx
run: brew install upx
if: ${{ runner.os == 'macOS' }}
- name: Install upx
run: choco install upx
if: ${{ runner.os == 'Windows' }}
- name: 'Set up Graal'
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: 21
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@v2
with:
name: artifacts
path: neo4j-migrations-cli/target/neo4j-migrations*.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@v3
with:
ref: ${{ env.refName }}
fetch-depth: 0
- name: 'Download all build artifacts'
uses: actions/download-artifact@v2
with:
name: artifacts
path: neo4j-migrations-cli/target
- name: 'Restore Maven packages'
uses: actions/cache@v3
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