-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.19 KB
/
publish_release.yml
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
name: Publish release
run-name: Publish release ${{ github.ref_name }} on ${{ github.sha }} by @${{ github.actor }}
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
publish-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check release version
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"
else
echo "Ref ${GITHUB_REF} is not a tag"
exit 1
fi
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Deploy
run: mvn -DskipTests --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
name: "${{ env.RELEASE_VERSION }}"
tag: ${{ env.RELEASE_VERSION }}
artifacts: "${{ github.workspace }}/target/azure-kafka-oauthbearer-*.jar"
token: ${{ secrets.GITHUB_TOKEN }}