-
Notifications
You must be signed in to change notification settings - Fork 13
87 lines (73 loc) · 2.32 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
name: Publish library release
on:
workflow_dispatch:
inputs:
version:
description: 'Library release version'
required: true
env:
NEW_VERSION: ${{ github.event.inputs.version }}
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.GITHUB_REF }}
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Ensure main branch
run: ./.github/sh/validate_publishing_branch.sh
- name: Validate library version update
run: ./.github/sh/validate_version_update.sh "libraryVersion" "$NEW_VERSION"
- name: Validate jitpack publishing
run: |
./gradlew \
-Pgroup=com.github.vivid-money \
-Pversion=$VERSION \
-xtest \
-xlint \
build \
publishToMavenLocal
release:
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.GITHUB_REF }}
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Update library version
run: ./.github/sh/update_release_version.sh "libraryVersion" "$NEW_VERSION"
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update library version to ${{ env.NEW_VERSION }}"
file_pattern: gradle.properties
skip_dirty_check: true
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
toTag: HEAD
failOnError: true
configuration: .github/changelogconfig/configuration.json
- name: Get current git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse HEAD)
echo "::set-output name=commit_sha::$calculatedSha"
- name: Create github release
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag: "${{ env.NEW_VERSION }}"
commit: "${{ steps.vars.outputs.commit_sha }}"
body: ${{ steps.github_release.outputs.changelog }}