add new API calls #33
This file contains hidden or 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 java API | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| run_tests: | |
| description: 'Run tests' | |
| required: true | |
| default: true | |
| type: boolean | |
| run_deploy: | |
| description: 'Deploy to GitHub Packages' | |
| required: true | |
| default: false | |
| type: boolean | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build with Maven | |
| run: mvn -B clean package --file pom.xml | |
| - name: Run Tests | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_tests || github.event_name != 'workflow_dispatch' }} | |
| run: mvn -B test --file pom.xml | |
| - name: Publish to GitHub Packages | |
| if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.run_deploy) }} | |
| run: mvn deploy -DskipTests | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |