Skip to content

Next release 1.4.0

Next release 1.4.0 #25

Workflow file for this run

# This workflow will build a package using Maven
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Package
on:
push:
branches:
- master
tags:
- '*' # Triggers releases for tags
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: github
settings-path: ${{ github.workspace }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Run the multi-module Maven build from the main pom.xml
- name: Build all modules with Maven
run: mvn -B package --file pom.xml
# Upload artifacts as build artifacts
- name: Archive alfviral-platform assets
uses: actions/upload-artifact@v4
with:
name: alfviral-platform
path: |
alfviral-platform/target/alfviral-platform-*.jar
alfviral-platform/target/alfviral-platform-*.amp
!alfviral-platform/target/*-tests.jar
- name: Archive alfviral-share assets
uses: actions/upload-artifact@v4
with:
name: alfviral-share
path: |
alfviral-share/target/alfviral-share-*.jar
alfviral-share/target/alfviral-share-*.amp
!alfviral-share/target/*-tests.jar
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Download alfviral-platform artifact
uses: actions/download-artifact@v4
with:
name: alfviral-platform
- name: Download alfviral-share artifact
uses: actions/download-artifact@v4
with:
name: alfviral-share
- name: Install xmllint
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
- name: Extract version from alfviral-platform/pom.xml
id: extract_platform_version
run: |
PLATFORM_VERSION=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' alfviral-platform/pom.xml)
echo "PLATFORM_VERSION=${PLATFORM_VERSION}" >> $GITHUB_ENV
- name: Extract version from alfviral-share/pom.xml
id: extract_share_version
run: |
SHARE_VERSION=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' alfviral-share/pom.xml)
echo "SHARE_VERSION=${SHARE_VERSION}" >> $GITHUB_ENV
- name: Create GitHub Release with Auto-generated Release Notes
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
generateReleaseNotes: true
name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
# Upload artifacts as release assets using v2
- name: Upload alfviral-platform .jar asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: alfviral-platform-${{env.PLATFORM_VERSION}}.jar
asset_name: alfviral-platform-${{ github.ref_name }}.jar
asset_content_type: application/java-archive
- name: Upload alfviral-platform .amp asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: alfviral-platform-${{env.PLATFORM_VERSION}}.amp
asset_name: alfviral-platform-${{ github.ref_name }}.amp
asset_content_type: application/octet-stream # or application/zip based on your preference
- name: Upload alfviral-share .jar asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: alfviral-share-${{env.SHARE_VERSION}}.jar
asset_name: alfviral-share-${{ github.ref_name }}.jar
asset_content_type: application/java-archive
- name: Upload alfviral-share .amp asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: alfviral-share-${{env.SHARE_VERSION}}.amp
asset_name: alfviral-share-${{ github.ref_name }}.amp
asset_content_type: application/octet-stream # or application/zip based on your preference