Skip to content

refactor: add pilotage components for NOAUTH/KEYCLOAK modes (#169) #54

refactor: add pilotage components for NOAUTH/KEYCLOAK modes (#169)

refactor: add pilotage components for NOAUTH/KEYCLOAK modes (#169) #54

Workflow file for this run

name: Build release candidate
on:
push:
branches:
- v4-develop #temp branch
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get version
id: version
run: echo "version=$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)-rc" >> $GITHUB_OUTPUT
- name: Print version
run: echo ${{ steps.version.outputs.version }}
- uses: mukunku/[email protected]
name: Check tag existence
id: check-tag-exists
with:
tag: ${{ steps.version-step.outputs.version }}
- name: Tag verification
id: check-tag
run: |
if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then
echo "Nothing to tag/release, the tag ${{ steps.version-step.outputs.version }} already exists"
exit 1
fi
create-release:
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Get previous tag
id: previousTag
run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+\-rc$' | tail -1)" >> $GITHUB_OUTPUT
# - name: Create release note
# id: changelog
# uses: requarks/changelog-action@v1
# with:
# fromTag: ${{ github.sha }}
# toTag: ${{ steps.previousTag.outputs.previousTag}}
# token: ${{ secrets.GITHUB_TOKEN }}
# writeToFile: false
#
# - uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ needs.check-version.outputs.release-version }}
# target_commitish: ${{ github.head_ref || github.ref }}
# name: ${{ needs.check-version.outputs.release-version }}
# body: ${{steps.changelog.outputs.changes}}
# prerelease: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-release:
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch
- uses: actions/checkout@v3
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
- name: Build App
run: mvn package --no-transfer-progress
- name: Upload App jar
uses: actions/upload-artifact@v3
with:
name: app-jar
path: target/*.jar
docker:
needs:
- check-version
- build-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download uploaded jar
uses: actions/download-artifact@v3
with:
name: app-jar
path: target/
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: inseefr/queen-back-office
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: "latest, ${{ needs.check-version.outputs.release-version }}"