v0.2.4 #2
Workflow file for this run
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
| # This workflow will publish the package to Maven Central when a release is created | |
| name: maven-publish | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| if: >- | |
| github.repository == 'WaveSpeedAI/wavespeed-java' && | |
| ((github.event_name == 'release' && github.ref_type == 'tag' && | |
| startsWith(github.ref, 'refs/tags/v')) || | |
| (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 # for tags | |
| persist-credentials: false | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Configure Git | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| - name: Build with Maven | |
| run: mvn -B clean package --no-transfer-progress --file pom.xml | |
| # TODO: Uncomment when Maven Central credentials are configured | |
| # - name: Publish to Maven Central | |
| # run: mvn -B deploy --no-transfer-progress --file pom.xml | |
| # env: | |
| # MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| # MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| # MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |