-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.25 KB
/
publish.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
47
48
49
50
name: Java Package Publishing
on:
workflow_dispatch:
inputs:
version:
description: 'Enter the new version for the package'
required: true
jobs:
build:
name: Build Reseller API
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Update Version
run: |
NEW_VERSION="${{ github.event.inputs.version }}"
mvn versions:set -DnewVersion=${NEW_VERSION}
git config --global user.email ${{secrets.ADMIN_EMAIL}}
git config --global user.name ${{secrets.ORG_NAME}}
git add .
if git diff --exit-code; then
echo "No changes to commit."
else
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
fi
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}