microsoft/gctoolkit

Public

mirrored from https://github.com/microsoft/gctoolkitAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
gctoolkit-3.0.5

Branches

Tags

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

Clone

HTTPS

Download ZIP

.github/workflows/release_to_github.yml

60lines · modeblame

d7040222David Grieve1 years ago1name: Release to GitHub
2
3on:
4workflow_dispatch:
5
6jobs:
7release:
c577cf20David Grieve1 years ago8permissions:
9contents: write
10
d7040222David Grieve1 years ago11runs-on: ubuntu-latest
12
13steps:
14- name: Checkout project
15uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16with:
17ref: main
18fetch-depth: 0
19
20- name: Cache Maven
21uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
22with:
23path: ~/.m2/repository
24key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25restore-keys: ${{ runner.os }}-m2
26
27- name: Setup Java JDK
28uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
29with:
30java-version: '11'
31distribution: 'microsoft'
32
33- name: Version
34id: version
35run: |
b0afe430David Grieve1 years ago36release_tag=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )
05a93f83David Grieve1 years ago37release_tag=${release_tag%-*}
17a482f3David Grieve1 years ago38echo "release_tag=gctoolkit-${release_tag}" >> "$GITHUB_ENV"
d7040222David Grieve1 years ago39
05a93f83David Grieve1 years ago40previous_tag=$( git tag --sort=-taggerdate --list 'gctoolkit-*' | head -n1 )
637824b3David Grieve1 years ago41echo "previous_tag=${previous_tag}" >> "$GITHUB_ENV"
d7040222David Grieve1 years ago42
43- name: Release Prepare
44run: |
45./mvnw -B -Prelease release:clean release:prepare \
46-Drepository.url=https://${{ github.actor }}:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }}.git
47env:
48GIT_AUTHOR_NAME: 'Git'
49GIT_AUTHOR_EMAIL: 'noreply@github.com'
50GIT_COMMITTER_NAME: 'Git'
51GIT_COMMITTER_EMAIL: 'noreply@github.com'
52
53- name: Release to GitHub
54run: |
05a93f83David Grieve1 years ago55git checkout "$release_tag"
d7040222David Grieve1 years ago56./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \
637824b3David Grieve1 years ago57-Djreleaser.previous.tag.name="$previous_tag" \
05a93f83David Grieve1 years ago58-Djreleaser.tag.name="$release_tag"
d7040222David Grieve1 years ago59env:
0a0152c5David Grieve1 years ago60JRELEASER_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}