Add test class #4
Workflow file for this run
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: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Java and Maven - setup settings.xml | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
server-id: github | |
cache: 'maven' | |
- name: Configure Git user | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
- name: Build and Test | |
run: | | |
./mvnw clean verify | |
- name: Get version | |
id: get-version | |
run: | | |
VERSION=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout ) | |
FINAL_NAME=$( ./mvnw help:evaluate -Dexpression=project.build.finalName -q -DforceStdout ) | |
echo "::set-output name=version::$VERSION" | |
echo "::set-output name=final-name::$FINAL_NAME" | |
- name: Display version | |
id: display-version | |
run: | | |
echo "version: ${{ steps.get-version.outputs.version }}" | |
echo "final_name: ${{ steps.get-version.outputs.final-name }}" | |
- name: Publish to Github Package | |
run: ./mvnw --batch-mode deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |