[releng] Fix the publish part of the workflow #55
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: Continuous integration | |
on: | |
push: | |
paths-ignore: | |
- "CHANGELOG.adoc" | |
- "README.adoc" | |
- "doc/**" | |
branches: | |
- "**" | |
tags: | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
if: github.event_name != 'pull_request' | |
with: | |
fetch-depth: 0 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
if: github.event_name == 'pull_request' | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup Java SDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: "temurin" | |
- name: Setup some global environment variables | |
run: | | |
echo "git_describe=$(git describe)" >> $GITHUB_ENV | |
echo "app_version_latest=$(grep version frontend/package.json | awk -F \" '{print $4}')" >> $GITHUB_ENV | |
- name: Build the frontend packages | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ github.token }}" >> .npmrc | |
echo "CI=true" >> $GITHUB_ENV | |
npm ci | |
npm run build | |
working-directory: frontend | |
- name: Copy frontend artifacts | |
run: | | |
mkdir -p backend/deeplab-frontend/src/main/resources/static | |
cp -R frontend/deeplab-web/dist/* backend/deeplab-frontend/src/main/resources/static | |
- name: Build the backend | |
env: | |
USERNAME: ${{ github.actor }} | |
PASSWORD: ${{ github.token }} | |
run: mvn -U -B -e clean verify -f backend/pom.xml --settings settings.xml | |
- name: Publish the backend | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
USERNAME: ${{ github.actor }} | |
PASSWORD: ${{ github.token }} | |
GITHUB_TOKEN: ${{ github.token }} | |
run: mvn -B deploy -DskipTests -f backend/pom.xml --settings settings.xml | |
- name: Store the fat jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: application fat jar | |
path: backend/deeplab-application/target/deeplab-application-${{ env.app_version_latest }}.jar |