-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.44 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
64
65
66
67
68
69
70
name: Release
on:
workflow_dispatch:
inputs:
requested_release_type:
description: 'Release type (may be overridden by commit messages, see mathieudutour/github-tag-action)'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
default_bump: ${{ github.event.inputs.requested_release_type }}
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: .*
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: adopt
- name: Build jar with Gradle
run: ./gradlew -Pversion='${{ steps.tag_version.outputs.new_version }}' jar
- name: Publish to GitHub Maven with Gradle
run: ./gradlew -Pversion='${{ steps.tag_version.outputs.new_version }}' publishGeowerkstattCustomFunctionsPublicationToGitHubPackagesRepository
env:
ORG_GRADLE_PROJECT_GITHUB_ACTOR: ${{ github.actor }}
ORG_GRADLE_PROJECT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- name: Publish to OSSRH Maven with Gradle
run: ./gradlew -Pversion='${{ steps.tag_version.outputs.new_version }}' publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_OSSRH_USER: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- uses: ncipollo/[email protected]
with:
artifacts: "build/libs/*.jar"
makeLatest: true
name: ${{ steps.tag_version.outputs.new_tag }}
tag: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
token: ${{ secrets.GITHUB_TOKEN }}