Skip to content

Add sonatype repository #7

Add sonatype repository

Add sonatype repository #7

Workflow file for this run

# 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: Maven Package
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Add Skript Dependency
run: sh ./scripts/installSkript.sh
- name: Clean & Install
run: mvn clean install --file pom.xml
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
# Only run mvn deploy when on Oliver's repo (aka. not forks)
# This is because the distribution repo is hardcoded in the pom file
if: github.repository == 'oliverdunk/JukeboxAPI'
run: mvn deploy -Dregistry=https://maven.pkg.github.com/${{ github.repository_owner }} -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}