Skip to content

Commit 7653ec1

Browse files
committed
release drafter and release actions
1 parent 71c5609 commit 7653ec1

File tree

5 files changed

+90
-3
lines changed

5 files changed

+90
-3
lines changed

.circleci.settings.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<servers>
33
<server>
44
<id>ossrh</id>
5-
<username>${env.OSSRH_USERNAME}</username>
6-
<password>${env.OSSRH_PASSWORD}</password>
5+
<username>${env.OSSH_USERNAME}</username>
6+
<password>${env.OSSH_PASSWORD}</password>
77
</server>
88
<server>
99
<id>gpg.passphrase</id>

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- run: mvn cobertura:cobertura
5757

58-
- run: bash <(curl -s https://raw.githubusercontent.com/codecov/codecov-action/master/codecov) -t ${CODECOV_TOKEN}
58+
- run: bash <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/master/codecov) -t ${CODECOV_TOKEN}
5959

6060
- early_return_for_forked_pull_requests
6161

.github/release-drafter-config.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name-template: 'Version $NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
categories:
4+
- title: 'Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: 'Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: 'Maintenance'
14+
label: 'chore'
15+
change-template: '- $TITLE (#$NUMBER)'
16+
exclude-labels:
17+
- 'skip-changelog'
18+
template: |
19+
## Changes
20+
21+
$CHANGES

.github/workflows/release-drafter.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
with:
16+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
17+
config-name: release-drafter-config.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: get version from tag
15+
id: get_version
16+
run: |
17+
realversion="${GITHUB_REF/refs\/tags\//}"
18+
realversion="${realversion//v/}"
19+
realversion=`echo ${realversion}|cut -d '-' -f 2-2`
20+
echo "::set-output name=VERSION::$realversion"
21+
22+
- name: Set up publishing to maven central
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: '8'
26+
distribution: 'adopt'
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
31+
- name: mvn versions
32+
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
33+
34+
- name: Install gpg key
35+
run: |
36+
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
37+
gpg --list-secret-keys --keyid-format LONG
38+
39+
- name: Publish
40+
run: |
41+
mvn --no-transfer-progress \
42+
--batch-mode \
43+
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
44+
-DskipTests deploy -P release
45+
env:
46+
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
47+
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}

0 commit comments

Comments
 (0)