fix: Update workflow to use --no-snapshot-updates flag to prevent SNA… #34
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
| name: Uploader and Publisher | |
| on: | |
| push: | |
| tags: | |
| - "*.*.*" | |
| jobs: | |
| publish-and-upload: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.base_ref }} | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| server-id: central | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - uses: jacobtomlinson/gha-find-replace@v3 | |
| with: | |
| include: 'pom.xml' | |
| find: '<version>dev</version>' | |
| replace: '<version>${{ github.ref_name }}</version>' | |
| - run: mvn --batch-mode --no-snapshot-updates verify deploy | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: target/*.jar | |
| generate_release_notes: true | |
| - uses: jacobtomlinson/gha-find-replace@v3 | |
| with: | |
| include: 'README.md' | |
| find: '<version>.+</version>' | |
| replace: '<version>${{ github.ref_name }}</version>' | |
| - uses: jacobtomlinson/gha-find-replace@v3 | |
| with: | |
| include: 'README.md' | |
| find: "version: '.+'" | |
| replace: "version: '${{ github.ref_name }}'" | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: 'docs: Updated to version `${{ github.ref_name }}`.' | |
| file_pattern: 'README.md' | |
| branch: main | |
| push_options: '--force' |