microsoft/gctoolkit

Public

mirrored fromhttps://github.com/microsoft/gctoolkitAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
release-3.7.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/release_to_github.yml

60lines · modecode

1name: Release to GitHub
2
3on:
4 workflow_dispatch:
5
6jobs:
7 release:
8 permissions:
9 contents: write
10
11 runs-on: ubuntu-latest
12
13 steps:
14 - name: Checkout project
15 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16 with:
17 ref: main
18 fetch-depth: 0
19
20 - name: Cache Maven
21 uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
22 with:
23 path: ~/.m2/repository
24 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25 restore-keys: ${{ runner.os }}-m2
26
27 - name: Setup Java JDK
28 uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
29 with:
30 java-version: '11'
31 distribution: 'microsoft'
32
33 - name: Version
34 id: version
35 run: |
36 release_tag=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )
37 release_tag=${release_tag%-*}
38 echo "release_tag=gctoolkit-${release_tag}" >> "$GITHUB_ENV"
39
40 previous_tag=$( git tag --sort=-taggerdate --list 'gctoolkit-*' | head -n1 )
41 echo "previous_tag=${previous_tag}" >> "$GITHUB_ENV"
42
43 - name: Release Prepare
44 run: |
45 ./mvnw -B -Prelease release:clean release:prepare \
46 -Drepository.url=https://${{ github.actor }}:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }}.git
47 env:
48 GIT_AUTHOR_NAME: 'Git'
49 GIT_AUTHOR_EMAIL: 'noreply@github.com'
50 GIT_COMMITTER_NAME: 'Git'
51 GIT_COMMITTER_EMAIL: 'noreply@github.com'
52
53 - name: Release to GitHub
54 run: |
55 git checkout "$release_tag"
56 ./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \
57 -Djreleaser.previous.tag.name="$previous_tag" \
58 -Djreleaser.tag.name="$release_tag"
59 env:
60 JRELEASER_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
61