|
| 1 | +name: Create and deploy Maven Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release-version: |
| 7 | + description: 'Release version' |
| 8 | + required: true |
| 9 | + default: '0.0.0' |
| 10 | + devel-version: |
| 11 | + description: 'Development version' |
| 12 | + required: true |
| 13 | + default: '0.0.0-SNAPSHOT' |
| 14 | + release-branch: |
| 15 | + description: 'Release branch' |
| 16 | + required: true |
| 17 | + default: 'master' |
| 18 | + devel-branch: |
| 19 | + description: 'Development branch' |
| 20 | + required: true |
| 21 | + default: 'jboss-repo' |
| 22 | + |
| 23 | +jobs: |
| 24 | + release-and-publish: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + name: "Release and publish Maven artifact" |
| 27 | + steps: |
| 28 | + - id: checkout |
| 29 | + name: "Checkout" |
| 30 | + uses: actions/checkout@v2 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + - id: setup-jdk |
| 34 | + name: "Set up JDK 11" |
| 35 | + uses: actions/setup-java@v2 |
| 36 | + with: |
| 37 | + java-version: 11 |
| 38 | + distribution: 'adopt' |
| 39 | + - id: perform |
| 40 | + name: "Perform Release" |
| 41 | + uses: mcarlett/release-explicit-version-action@v0.28 |
| 42 | + with: |
| 43 | + release-version: ${{ github.event.inputs.release-version }} |
| 44 | + devel-version: ${{ github.event.inputs.devel-version }} |
| 45 | + devel-branch: ${{ github.event.inputs.devel-branch }} |
| 46 | + release-branch: ${{ github.event.inputs.release-branch }} |
| 47 | + - id: install-package |
| 48 | + name: "Install package" |
| 49 | + run: mvn clean install -U -B -DskipTests=true |
| 50 | + - id: maven-verify |
| 51 | + name: "Maven Verify" |
| 52 | + run: mvn -B verify |
| 53 | + - id: custom-settings |
| 54 | + name: "Create custom Maven settings" |
| 55 | + uses: whelk-io/maven-settings-xml-action@v14 |
| 56 | + with: |
| 57 | + servers: '[{"id":"jboss-releases-repository","username":"${env.JBOSS_USERNAME}","password":"${env.JBOSS_PASSWORD}"},{"id":"jboss-snapshots-repository","username":"${env.JBOSS_USERNAME}","password":"${env.JBOSS_PASSWORD}"}]' |
| 58 | + - id: maven-deploy |
| 59 | + name: "Maven Deploy" |
| 60 | + run: mvn deploy -DskipTests |
| 61 | + env: |
| 62 | + JBOSS_USERNAME: ${{ secrets.JBOSS_USERNAME }} |
| 63 | + JBOSS_PASSWORD: ${{ secrets.JBOSS_PASSWORD }} |
| 64 | + - id: create-release |
| 65 | + name: "Create GitHub Release" |
| 66 | + uses: actions/create-release@v1 |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + with: |
| 70 | + tag_name: refs/tags/${{ steps.perform.outputs.generated-tag }} |
| 71 | + release_name: Release ${{ steps.perform.outputs.generated-tag }} |
| 72 | + draft: false |
| 73 | + prerelease: false |
| 74 | + - id: show-tag |
| 75 | + name: "Show generated tag" |
| 76 | + run: "echo generated release: ${{ steps.perform.outputs.generated-tag }}" |
| 77 | + shell: bash |
0 commit comments