-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (94 loc) · 3.08 KB
/
release.yml
File metadata and controls
104 lines (94 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Release Creation
on:
workflow_dispatch:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: false
type: string
workflow_call:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: false
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
lfs: true
- name: Download CLI
if: inputs.cliTag
run: |
chmod +x ./.github/scripts/update_cli.sh
./.github/scripts/update_cli.sh ${{ inputs.cliTag }}
- name: Tag
run: |
echo ${{ inputs.tag }}
tag=${{ inputs.tag }}
echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
message='${{ inputs.tag }}'
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Maven Central Repository
uses: actions/setup-java@v4.0.0
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Update the POM version.
run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests
- name: Build artifactId property
run: |
prop=''
if [ ${{ inputs.dev }} = true ] && ![ "${{ inputs.tag }}" = "1.0.0-SNAPSHOT" ]; then
prop='-Dast.wrapper.id=ast-cli-java-wrapper-dev'
fi
echo "AID_PROP=${prop}" >> $GITHUB_ENV
- name: Publish package
run: mvn --batch-mode deploy -DskipTests ${{ env.AID_PROP }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 #v2
with:
generate_release_notes: true
tag_name: ${{ inputs.tag }}
prerelease: ${{ inputs.dev }}