-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 2.27 KB
/
deploy-auto-merged-prs.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
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
name: Push
on:
workflow_run:
workflows: [ Pull Request ]
types: [ completed ]
jobs:
build:
permissions:
contents: read
checks: write
actions: read
id-token: write
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: gradle/[email protected]
with:
arguments: test --continue --no-daemon
gradle-home-cache-cleanup: true
- uses: dorny/[email protected]
if: always()
with:
name: test
path: "*/build/test-results/test/TEST-*.xml"
reporter: java-junit
token: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # include git tags
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: paulhatch/[email protected]
id: tag
with:
bump_each_commit: true
tag_prefix: ""
- id: notes
run: |
randomDelimiter=${RANDOM}
text="$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")"
echo 'CHANGELOG<<$randomDelimiter' >> $GITHUB_OUTPUT
echo $text >> $GITHUB_OUTPUT
echo '$randomDelimiter' >> $GITHUB_OUTPUT
- uses: actions/[email protected]
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.version }}
release_name: ${{ steps.tag.outputs.version }}
body: |
Changes in this Release
${{ steps.notes.outputs.CHANGELOG }}
- uses: gradle/[email protected]
with:
arguments: -Pversion=${{ steps.tag.outputs.version }} publish
gradle-home-cache-cleanup: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}