-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (95 loc) · 2.98 KB
/
release.yml
File metadata and controls
114 lines (95 loc) · 2.98 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Build
on:
push:
tags:
- 'v*'
env:
JAVA_VERSION: 17
GRADLE_VERSION: 8.8
jobs:
build:
name: Build and Release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: ${{ env.JAVA_VERSION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: ${{ env.GRADLE_VERSION }}
dependency-graph: generate-and-submit
- name: Get version
id: get_version
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
- name: Build with Gradle (Release)
run: ./gradlew build test --stacktrace --no-daemon -Pversion=${{ steps.get_version.outputs.RELEASE_VERSION }}
- name: capture build artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: '**/build/libs/*.jar'
release:
name: Release
needs: build
if: ${{startsWith(github.ref, 'refs/tags/v')}}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: Artifacts
path: artifacts
- name: Find Last Tag
id: last
uses: jimschubert/query-tag-action@v2
with:
include: 'v*'
exclude: '*-rc*'
commit-ish: 'HEAD~'
skip-unshallow: 'true'
- name: Find Current Tag
id: current
uses: jimschubert/query-tag-action@v2
with:
include: 'v*'
exclude: '*-rc*'
commit-ish: '@'
skip-unshallow: 'true'
- name: Create Changelog
id: changelog
uses: jimschubert/beast-changelog-action@v1
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
CONFIG_LOCATION: .github/changelog.yml
FROM: ${{steps.last.outputs.tag}}
TO: ${{steps.current.outputs.tag}}
OUTPUT: .github/CHANGELOG.md
- name: View Changelog
run: cat .github/CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*.jar
body_path: .github/CHANGELOG.md
generate_release_notes: false
make_latest: true
- name: Get version
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: get_version
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
- name: Trigger JitPack Release
run: |
JITPACK_URL="https://jitpack.io/com/github/jimschubert/rewrite-docker/${{ steps.get_version.outputs.RELEASE_VERSION }}/"
curl -X POST -s -m 30 ${JITPACK_URL} || true