-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.92 KB
/
maven-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
name: Release
on:
push:
tags:
- v*
jobs:
github:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Maven Dependencies
if: always()
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: mvn-repository
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Maven Release
id: maven_release
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.SIGNING_GPG_PRIVATE_KEY_PASSPHRASE }}
GPG_KEYNAME: ${{ secrets.SIGNING_GPG_PRIVATE_KEY_NAME }}
run: |
echo "${{ secrets.SIGNING_GPG_PRIVATE_KEY }}" | gpg --batch --no-tty --import
sed -i 's@<password>__GITHUB_TOKEN__.*$@<password>${{ secrets.GITHUB_TOKEN }}</password>@g' ${{ github.workspace }}/.mvn/settings.xml
mvn deploy --settings ${{ github.workspace }}/.mvn/settings.xml --batch-mode --no-transfer-progress -Prelease,gpg,github -Dmaven.wagon.http.pool=false
echo "##[set-output name=tag;]$(echo ${{ github.ref }} | sed 's@refs/tags/@@g')"
- name: GitHub Release
id: github_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.maven_release.outputs.tag }}
release_name: ${{ steps.maven_release.outputs.tag }}
body:
draft: false
prerelease: false
- name: GitHub Release Upload
id: github_release_upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: find . -name "*.jar" -exec .github/upload-github-release-asset.sh repo=${{ github.repository }} id=${{ steps.github_release.outputs.id }} filename={} ";"