-
-
Notifications
You must be signed in to change notification settings - Fork 65
147 lines (136 loc) · 6.55 KB
/
Copy pathrelease.yml
File metadata and controls
147 lines (136 loc) · 6.55 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: release
on:
workflow_dispatch:
inputs:
commons_version:
description: 'New killbill-commons version'
required: false
default: ''
base_plugin_version:
description: 'New killbill-base-plugin version'
required: false
default: ''
platform_version:
description: 'New killbill-platform version'
required: false
default: ''
java_client_version:
description: 'New killbill-client version'
required: false
default: ''
perform_version:
description: 'tag to (re-)perform (in case of release:perform failure)'
required: false
default: ''
env:
MAVEN_FLAGS: "-B --no-transfer-progress"
MAVEN_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3"
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
if: github.event.inputs.perform_version == ''
uses: actions/checkout@v4
- name: Checkout full repository
# Required when performing an existing release.
if: github.event.inputs.perform_version != ''
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Setup git user
env:
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
run: |
git config --global user.email "contact@killbill.io"
git config --global user.name "Kill Bill core team"
git config --global url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "git@github.com:"
- name: Configure Java
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
- name: Download Java dependencies
# We do as much as we can, but it may not be enough (https://issues.apache.org/jira/browse/MDEP-82)
run: |
mvn ${MAVEN_FLAGS} clean install dependency:resolve dependency:resolve-plugins -DskipTests=true -Dgpg.skip=true -Psonatype-oss-release
- name: Update killbill-commons
if: github.event.inputs.commons_version != ''
run: |
echo "Updating pom.xml to ${{ github.event.inputs.commons_version }}:"
mvn ${MAVEN_FLAGS} versions:set-property -Dproperty=killbill-commons.version -DnewVersion=${{ github.event.inputs.commons_version }}
echo "pom.xml changes:"
git --no-pager diff
echo "Downloading new dependencies:"
mvn ${MAVEN_FLAGS} -U clean install -DskipTests
git add pom.xml
# Will be pushed as part of the release process, only if the release is successful
git commit -m "pom.xml: update killbill-commons to ${{ github.event.inputs.commons_version }}"
- name: Update killbill-base-plugin
if: github.event.inputs.base_plugin_version != ''
run: |
echo "Updating pom.xml to ${{ github.event.inputs.base_plugin_version }}:"
mvn ${MAVEN_FLAGS} versions:set-property -Dproperty=killbill-base-plugin.version -DnewVersion=${{ github.event.inputs.base_plugin_version }}
echo "pom.xml changes:"
git --no-pager diff
echo "Downloading new dependencies:"
mvn ${MAVEN_FLAGS} -U clean install -DskipTests
git add pom.xml
# Will be pushed as part of the release process, only if the release is successful
git commit -m "pom.xml: update killbill-base-plugin to ${{ github.event.inputs.base_plugin_version }}"
- name: Update killbill-platform
if: github.event.inputs.platform_version != ''
run: |
echo "Updating pom.xml to ${{ github.event.inputs.platform_version }}:"
mvn ${MAVEN_FLAGS} versions:set-property -Dproperty=killbill-platform.version -DnewVersion=${{ github.event.inputs.platform_version }}
echo "pom.xml changes:"
git --no-pager diff
echo "Downloading new dependencies:"
mvn ${MAVEN_FLAGS} -U clean install -DskipTests
git add pom.xml
# Will be pushed as part of the release process, only if the release is successful
git commit -m "pom.xml: update killbill-platform to ${{ github.event.inputs.platform_version }}"
- name: Update killbill-client
if: github.event.inputs.java_client_version != ''
run: |
echo "Updating pom.xml to ${{ github.event.inputs.java_client_version }}:"
mvn ${MAVEN_FLAGS} versions:set-property -Dproperty=killbill-client.version -DnewVersion=${{ github.event.inputs.java_client_version }}
echo "pom.xml changes:"
git --no-pager diff
echo "Downloading new dependencies:"
mvn ${MAVEN_FLAGS} -U clean install -DskipTests
git add pom.xml
# Will be pushed as part of the release process, only if the release is successful
git commit -m "pom.xml: update killbill-client to ${{ github.event.inputs.java_client_version }}"
- name: Configure settings.xml for release
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Release artifacts
if: github.event.inputs.perform_version == ''
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# It will still check the remote but hopefully not download much (0 B at 0 B/s). -o isn't safe because of MDEP-82 (see above).
run: |
mvn ${MAVEN_FLAGS} release:clean release:prepare release:perform
- name: Perform release
if: github.event.inputs.perform_version != ''
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# It will still check the remote but hopefully not download much (0 B at 0 B/s). -o isn't safe because of MDEP-82 (see above).
# See https://issues.apache.org/jira/browse/SCM-729 for why the release.properties file is required.
run: |
echo "scm.url=scm\:git\:git@github.com\:${GITHUB_REPOSITORY}.git" > release.properties
echo "scm.tag=${{ github.event.inputs.perform_version }}" >> release.properties
mvn ${MAVEN_FLAGS} release:perform