-
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.73 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Release
permissions:
contents: write
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
name: Release
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.vars.outputs.version }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: current
- name: Cache konan dependencies
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get version number from tag
id: vars
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
shell: bash
- name: Publish with Gradle
env:
release: true
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{secrets.SONATYPE_USERNAME}}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{secrets.SONATYPE_PASSWORD}}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{secrets.GPG_KEY_CONTENT}}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{secrets.GPG_KEY_ID}}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{secrets.GPG_KEY_PWD}}
run: ./gradlew publishAllPublicationsToMavenCentralRepository -PlibVersion=${{ steps.vars.outputs.version }} --no-parallel
- name: Publish documentation
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
BRANCH: gh-pages
FOLDER: re.this/build/dokka
finalize:
name: Finalize
runs-on: ubuntu-latest
needs: release
steps:
- name: Replace version in README.md
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '([:"])([0-9]+\.[0-9]+\.[0-9]+)\"'
replace: "${1}${{ steps.vars.outputs.version }}\""
include: "**README.md"
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Bump library version.
branch: master
- name: Extract changelog for version
id: changelog
run: |
./parse_changelog.sh ${{ needs.version.outputs.version }} > release_notes.md
shell: bash
- name: Create release
uses: taiki-e/create-gh-release-action@v1
with:
title: ${{ steps.vars.outputs.version }}
changelog: release_notes.md
branch: master
token: ${{ secrets.ACCESS_TOKEN }}