microsoft/gctoolkit
Publicmirrored from https://github.com/microsoft/gctoolkitAvailable
.github/workflows/publish.yml
47lines · modecode
| 1 | name: Publish package to GitHub Packages |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: [created] |
| 6 | |
| 7 | jobs: |
| 8 | publish: |
| 9 | |
| 10 | runs-on: ubuntu-latest |
| 11 | |
| 12 | permissions: |
| 13 | contents: write |
| 14 | packages: write |
| 15 | |
| 16 | steps: |
| 17 | - name: Checkout project |
| 18 | uses: actions/checkout@v2 |
| 19 | with: |
| 20 | ref: main |
| 21 | |
| 22 | - name: Setup Java JDK |
| 23 | uses: actions/setup-java@v2 |
| 24 | with: |
| 25 | java-version: '11' |
| 26 | distribution: 'adopt' |
| 27 | server-id: github |
| 28 | |
| 29 | - name: Configure Git user |
| 30 | run: | |
| 31 | git config user.email "actions@github.com" |
| 32 | git config user.name "GitHub Actions" |
| 33 | - name: Prepare the release |
| 34 | run: mvn -B release:prepare -DpushChanges=false |
| 35 | env: |
| 36 | GITHUB_TOKEN: ${{ secrets.TEMP_PAT }} |
| 37 | |
| 38 | - name: Perform the release |
| 39 | run: mvn -B release:perform -DlocalCheckout=true -Darguments="-DskipTests -Dmaven.javadoc.skip=true" |
| 40 | env: |
| 41 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 42 | |
| 43 | - name: Bump pom version |
| 44 | run : git push |
| 45 | |
| 46 | - name: Push tags |
| 47 | run: git push --tags |
| 48 | |