Merge pull request #111 from whitesource/TKA-7788 #3
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: Deploy Snapshot | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "**/*.md" | |
| jobs: | |
| deploy-snapshot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "8" | |
| distribution: "temurin" | |
| server-id: sonatype-nexus-snapshots | |
| server-username: ${{ secrets.OSSRH_USERNAME }} | |
| server-password: ${{ secrets.OSSRH_TOKEN }} | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Create Maven settings.xml | |
| run: | | |
| mkdir -p ~/.m2 | |
| echo "<settings> | |
| <servers> | |
| <server> | |
| <id>sonatype-nexus-snapshots</id> | |
| <username>${{ secrets.OSSRH_USERNAME }}</username> | |
| <password>${{ secrets.OSSRH_TOKEN }}</password> | |
| </server> | |
| </servers> | |
| </settings>" > ~/.m2/settings.xml | |
| - name: Verify SNAPSHOT version | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| if [[ $VERSION != *"-SNAPSHOT" ]]; then | |
| echo "Error: Version must be a SNAPSHOT" | |
| exit 1 | |
| fi | |
| - name: Build and deploy | |
| run: mvn -B clean deploy -Pci-build |