Skip to content

Mateu 3.0-alpha.86 #169

Mateu 3.0-alpha.86

Mateu 3.0-alpha.86 #169

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Build and publish
on:
release:
types: [published]
jobs:
all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: VERSION=${{ github.event.release.tag_name }}; echo "RELEASE_VERSION=${VERSION:1}" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build front
run: cd frontend/web/vaadin && npm i && npm run build && npm run copy
- name: fix version
run: grep -rl '<version>0.0.1-MATEU</version>' --exclude-dir=.git backend | grep pom.xml | xargs sed -i 's/0\.0\.1\-MATEU/${{ env.RELEASE_VERSION }}/g'
- name: Build with Maven
run: mvn -B install --file backend/webflux/pom.xml
- name: Publish to Maven Central
run: mvn deploy -f backend/webflux/pom.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}