-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.93 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release Libraries
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Choose the release type (patch|minor|major)'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
releaseVersion:
description: 'Set the release version (overrides release type)'
required: false
type: string
jobs:
build:
# if: contains('["renelink"]', github.actor)
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Validate Workflow Inputs
id: validate
run: |
export RELEASE_ARG="${{ inputs.releaseVersion || inputs.releaseType }}"
[[ "$RELEASE_ARG" =~ ^([0-9]+.[0-9]+.[0-9]+|patch|minor|major)$ ]] || \
{ echo "$RELEASE_ARG is not a valid release argument! Use ^([0-9]+.[0-9]+.[0-9]+|patch|minor|major)$ "; exit 1; }
echo "RELEASE_ARG=${RELEASE_ARG}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
- name: Configure Git User
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Build with Gradle Wrapper
run: |
./.bin/gradlew_release ${{ steps.validate.outputs.RELEASE_ARG }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUSH_TOKEN}}