Merge pull request #3 from OCTRI/AUTHLIB-153 #10
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 | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
types: | |
- opened | |
- edited | |
workflow_dispatch: | |
jobs: | |
build-java-source: | |
name: build jar file | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Java build environmant | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn package | |
- name: Get Version from POM | |
id: get-version | |
run: | | |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Publish SNAPSHOT JAR | |
if: github.ref == 'refs/heads/main' && contains(env.version, '-SNAPSHOT') | |
run: mvn deploy -DskipTests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |