Make it possible to mark as ignored #124
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: Test and Release | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
cache: 'maven' | |
- run: > | |
mvn --batch-mode | |
--update-snapshots | |
--activate-profiles analyze,its | |
verify | |
com.github.spotbugs:spotbugs-maven-plugin:4.4.2:spotbugs | |
com.github.spotbugs:spotbugs-maven-plugin:4.4.2:check --define spotbugs.excludeFilterFile=spotbugs-suppressions.xml | |
release: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/release-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
cache: 'maven' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- id: find-version | |
uses: actions/github-script@v4 | |
with: | |
script: | | |
const tag = context.ref.substring(10) | |
const no_release = tag.replace('release-', '') | |
const dash_index = no_release.lastIndexOf('-') | |
const no_dash = (dash_index > -1) ? no_release.substring(0, dash_index) : no_release | |
core.setOutput('tag', tag) | |
core.setOutput('no-release', no_release) | |
core.setOutput('no-dash', no_dash) | |
- run: > | |
mvn --batch-mode | |
versions:set | |
--define newVersion=${{ steps.find-version.outputs.no-dash }} | |
- run: mvn --batch-mode --activate-profiles sign deploy | |
env: | |
MAVEN_USERNAME: vandmo | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |