-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.03 KB
/
release.yaml
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
name: release
on:
push:
tags:
- v*
jobs:
release-job:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Remove snapshot from version
run: mvn --batch-mode versions:set -DremoveSnapshot
- name: Fetch pom version
run: echo "pom_version=v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV"
- name: Check pom version
if: ${{ env.pom_version != github.ref_name }}
run: |
echo "::error The pom version ${{ env.pom_version }} differs from the tag ${{ github.ref_name }}"
exit 1
- name: Publish release package
if: ${{ env.pom_version == github.ref_name }}
run: mvn --batch-mode clean deploy
env:
PACKAGES_WRITE_PAT: ${{ secrets.GITHUB_TOKEN }}
PACKAGES_READ_PAT: ${{ secrets.GITHUB_TOKEN }}