|
| 1 | +# This file will result in a new townyresources release version being deployed. |
| 2 | +name: Deploy Release |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + CURR_VER: 0.0.0 |
| 8 | + |
| 9 | +jobs: |
| 10 | + deploy_release_as_draft: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + java: ['17'] |
| 15 | + name: Creating CommentedConfiguration Release |
| 16 | + steps: |
| 17 | + - name: checkout repo content |
| 18 | + uses: actions/checkout@v3 # checkout the repository content to github runner. |
| 19 | + |
| 20 | + - name: set up eclipse temurin |
| 21 | + uses: actions/setup-java@v3 |
| 22 | + with: |
| 23 | + distribution: 'temurin' |
| 24 | + java-version: ${{ matrix.java }} |
| 25 | + java-package: jdk |
| 26 | + cache: 'maven' |
| 27 | + |
| 28 | + - name: compile commentedconfiguration with maven |
| 29 | + env: |
| 30 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + run: mvn -B clean package |
| 32 | + |
| 33 | + - name: find current version |
| 34 | + run: | |
| 35 | + export POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) |
| 36 | + echo "CURR_VER=$POM_VERSION" >> $GITHUB_ENV |
| 37 | +
|
| 38 | + - name: create release |
| 39 | + uses: softprops/action-gh-release@v1 |
| 40 | + with: |
| 41 | + generate_release_notes: true |
| 42 | + append_body: false |
| 43 | + draft: false |
| 44 | + prerelease: false |
| 45 | + token: ${{ github.token }} |
| 46 | + tag_name: ${{ env.CURR_VER }} |
| 47 | + name: ${{ env.CURR_VER }} |
| 48 | + files: | |
| 49 | + ./target/CommentedConfiguration-${{ env.CURR_VER }}.jar |
| 50 | + env: |
| 51 | + GITHUB_REPOSITORY: my_gh_org/my_gh_repo |
| 52 | + |
| 53 | + - name: prepare maven settings.xml |
| 54 | + uses: s4u/maven-settings-action@v2.8.0 |
| 55 | + with: |
| 56 | + githubServer: false |
| 57 | + servers: | |
| 58 | + [{ |
| 59 | + "id": "nexus", |
| 60 | + "username": "${{ secrets.GLAREREPO_USERNAME }}", |
| 61 | + "password": "${{ secrets.GLAREREPO_PASSWORD }}" |
| 62 | + }] |
| 63 | +
|
| 64 | + - name: deploy to glaremaster repo |
| 65 | + run: mvn deploy |
0 commit comments