generated from creek-service/single-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.19 KB
/
release.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
# A Workflow for triggering a new release.
name: Release
on: [workflow_dispatch]
permissions:
contents: read
concurrency: "${{ github.repository }}-versioning"
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
- name: Fetch version history
run: git fetch --tags --unshallow
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff # v3.3.2
with:
gradle-home-cache-cleanup: true
- name: Ensure build is green
run: ./gradlew build
- name: Release
run: |
# The following command will trigger the build.yml workflow as it pushes a release tag
./gradlew release
- name: Capture version info
run: |
echo "Release version: $(./gradlew cV -q -Prelease.quiet)" >> $GITHUB_STEP_SUMMARY