Java CI - build, test and release to Maven Central #1
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: Build, test and release to Github Packages | |
on: | |
workflow_dispatch: | |
release: | |
types: [ created ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '1.8' | |
distribution: 'semeru' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Setup Maven Action | |
uses: s4u/setup-maven-action@v1.11.0 | |
with: | |
maven-version: 3.9.6 | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn deploy | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |