Skip to content

deploy to github packages #90

deploy to github packages

deploy to github packages #90

name: Build and Test
on:
push:
workflow_dispatch:
# list of OSes and what they contain https://github.com/actions/virtual-environments
jobs:
# This steps uses the maven cache better
Prepare-Maven:
runs-on: ubuntu-latest
env:
MAVEN_OPTS: "-Xmx6144m"
steps:
- name: ↙️ Check out repository code from git
uses: actions/checkout@v3
with:
repository: Calpano/graphinout
path: graphinout
- name: ☕ Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: "🐹 Download all dependencies and 'go offline'"
working-directory: graphinout
run: mvn --batch-mode org.apache.maven.plugins:maven-dependency-plugin:3.2.0:go-offline
Build-and-Test:
needs: Prepare-Maven
runs-on: ubuntu-latest
env:
MAVEN_OPTS: "-Xmx6144m"
steps:
- name: ↙️ Check out repository code from git
uses: actions/checkout@v3
with:
repository: Calpano/graphinout
path: graphinout
- name: ☕ Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: ⬇️ Install root project
working-directory: graphinout
run: mvn clean -N install
- name: 🔨️ Build & ⬇ install base
working-directory: graphinout/base
run: mvn clean install
- name: 🔨️ Build & ⬇ install readers
working-directory: graphinout
run: mvn clean -pl !base,!engine,!app-cmdline,!app-rest-service install
- name: 🔨️ Build & ⬇ install engine
working-directory: graphinout
run: mvn clean -pl engine install
- name: 🔨️ Build & ⬇ install app-cmdline
working-directory: graphinout
run: mvn clean -pl app-cmdline install
- name: 🔨️ Build & ⬇ install app-rest-service
working-directory: graphinout
run: mvn clean -pl app-rest-service install
- name: ↗️ Deploy
working-directory: graphinout
run: mvn deploy
- name: Deploy to Github Package Registry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p ~/.m2
echo "<settings><servers><server><id>gh</id><username>$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')</username><password>\${env.GITHUB_TOKEN}</password></server></servers></settings>" > ~/.m2/settings.xml
REPO="gh::default::https://maven.pkg.github.com/${GITHUB_REPOSITORY}"
mvn deploy -DaltReleaseDeploymentRepository="${REPO}" -DaltSnapshotDeploymentRepository="${REPO}"