-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (63 loc) · 1.9 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
name: Create Maven release
on:
push:
tags:
- '*'
jobs:
build:
name: Build release
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v2
with:
java-version: 8
distribution: adopt
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set version
run: mvn -B versions:set -DnewVersion=${{ env.TAG }} versions:commit
- name: Create settings.xml
uses: whelk-io/maven-settings-xml-action@v15
with:
servers: |
[
{
"id": "oss.sonatype.org",
"username": "${{ secrets.SONATYPE_USER }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}
]
profiles: |
[
{
"id": "artipie",
"properties": {
"gpg.keyname": "${{ secrets.GPG_KEYNAME }}",
"gpg.passphrase": "${{ secrets.GPG_PASSPHRASE }}"
}
}
]
- name: Deploy artifacts
run: mvn deploy -Partipie,publish,sonatype,gpg-sign -DskipITs --errors
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.TAG }}
draft: false
prerelease: false