-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (64 loc) · 2.28 KB
/
Copy pathdeploy.yml
File metadata and controls
74 lines (64 loc) · 2.28 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
name: Deploy Boomerang
on:
workflow_dispatch:
env:
BRANCH_NAME: snapshot_version
jobs:
deployment:
runs-on: ubuntu-latest
name: Deploy to Maven
environment: Deploy
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Deploy version
uses: secure-software-engineering/actions/deployment/maven-deployment@develop
with:
java-distribution: adopt
java-version: 11
server-id: central
server-username: ${{ secrets.MAVEN_USERNAME }}
server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
mvn-cli-args: '-DskipTests -Pdeployment'
deploy-mode: release
snapshot-version:
runs-on: ubuntu-latest
needs: deployment
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create branch and update to next SNAPSHOT version
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git checkout -b ${{ env.BRANCH_NAME }} master
mvn versions:set versions:commit -DnextSnapshot
git ls-files | grep 'pom.xml$' | xargs git add
git commit --allow-empty -am "Update version to next SNAPSHOT"
git push origin ${{ env.BRANCH_NAME }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR for SNAPSHOT version
run: |
gh pr create --draft -B develop -H ${{ env.BRANCH_NAME }} -t "Update to next SNAPSHOT version" -b "Update to next SNAPSHOT version"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
needs: deployment
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Create GitHub release
run: |
gh release create ${{ env.tag }} --title ${{ env.tag }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}