-
Notifications
You must be signed in to change notification settings - Fork 12
68 lines (60 loc) · 1.66 KB
/
release-types.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
name: Release types
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Release type
required: true
options:
- major
- minor
- patch
default: patch
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get next version
uses: rmeneely/git-next-version@v1
with:
tag_pattern: 'types_v[0-9]*.[0-9]*.[0-9]*'
increment: ${{ inputs.type }}
- name: Format version
id: format
uses: mad9000/actions-find-and-replace-string@5
with:
source: ${{ env.NEXT_VERSION }}
find: 'types_v'
replace: ''
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.gradle/caches
~/.gradle/wrapper
key: 11-node-${{ hashFiles('**/package-lock.json') }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: 11-
- name: Publish artifacts
run: ./gradlew clean types:publish -x test -PreleaseVersion=${{steps.format.outputs.value}}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "types/build/libs/types-*"
allowUpdates: true
generateReleaseNotes: true
commit: main
tag: ${{ env.NEXT_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}