Skip to content

Release 1.17.30

Release 1.17.30 #38

# This workflow will create new binaries when a release is created, and it attaches them to the release
name: Generate binaries
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Generate executable - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest, windows-2019]
os: [windows-2019]
graalvm-version: ['22.3.1']
java-version: ['17']
include:
# - os: ubuntu-latest
# executable-suffix: ''
# native-build-args: '-J-Xmx10g'
# - os: macos-latest
# executable-suffix: ''
# native-build-args: '-J-Xmx10g'
- os: windows-2019
executable-suffix: '.exe'
native-build-args: '-J-Xmx10g'
steps:
# OS customizations that allow the builds to succeed on Linux and Windows.
# Using hash for better security due to third party actions.
- name: Set up swap space
if: runner.os == 'Linux'
# v1.0 (49819abfb41bd9b44fb781159c033dba90353a7c)
uses: pierotofy/[email protected]
with:
swap-size-gb: 10
- name:
Configure pagefile
uses: al-cheb/[email protected]
if: runner.os == 'Windows'
with:
minimum-size: 10GB
maximum-size: 12GB
- name: Set up pagefile
if: runner.os == 'Windows'
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
shell: pwsh
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout release tag
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
run: |
RELEASE_TAG=${{ github.event.release.tag_name }}
CLEAN_RELEASE_TAG=`echo "${RELEASE_TAG//Release_Tag_}"`
echo "CHECKOUT_TAG=${CLEAN_RELEASE_TAG}" >> $GITHUB_ENV
echo "Haciendo checkout del tag ${CLEAN_RELEASE_TAG}"
git checkout ${CLEAN_RELEASE_TAG}
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Find out version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PROJECT_VERSION=`mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
CLEAN_PROJECT_VERSION=`echo "${PROJECT_VERSION%-SNAPSHOT}"`
echo "RELEASE_VERSION=${CLEAN_PROJECT_VERSION}" >> $GITHUB_ENV
echo "Generando release de la versión ${CLEAN_PROJECT_VERSION} basada en el checkout del tag ${CHECKOUT_TAG}"
- id: executable
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
run: |
echo "name=epl_librarian-${{ runner.os }}-${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
- name: Set up GraalVM (Java ${{ matrix.java-version }})
uses: graalvm/setup-graalvm@v1
with:
version: '${{ matrix.graalvm-version }}'
java-version: '${{ matrix.java-version }}'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ steps.executable.outputs.name }} native image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -Pdeployment package
mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests -Dassembly.skipAssembly=true -Dnative-image-name=${{ env.name }} -Dnative-build-args=${{ matrix.native-build-args }} -Pnative native:compile
- name: Package binary release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -Ppackage-native assembly:single -Ddescriptor-ref=${{ runner.os }}
- name: Upload release
if: github.event.release.tag_name
run: gh release upload ${{ github.event.release.tag_name }} target/epl_librarian-${{ env.RELEASE_VERSION }}-${{ runner.os }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}