-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.17 KB
/
release.yaml
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
name: Release to Docker
on:
push:
branches:
- 'release/*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Calculate version
id: spell
uses: actoaps/version-spell@v3
- name: Set up JDK 15
uses: actions/setup-java@v1
with:
java-version: 15.0.1
- name: Gradle Build
run: |
./gradlew clean build
- name: Import GPG key
id: gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
- name: Set up QEMU for multiarch docker builds
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build webservice and publish to Docker hub
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./webservice
platforms: linux/amd64,linux/arm64
push: true
tags: |
actoaps/web-dispatcher:${{ steps.spell.outputs.version }}
actoaps/web-dispatcher:latest
- name: Release client to Maven Central
run: |
gpg --export-secret-keys > secring.gpg
./gradlew :dispatcher-client:uploadArchives -Psigning.keyId=$KEY_ID -Psigning.password="" -Psigning.secretKeyRingFile=../secring.gpg -PnexusUsername=$USERNAME -PnexusPassword=$PASSWORD -DversionOverride=$BUILD_ID
./gradlew closeAndReleaseRepository -PnexusUsername=$USERNAME -PnexusPassword=$PASSWORD
env:
KEY_ID: ${{ secrets.MAVEN_GPG_KEY_ID }}
USERNAME: ${{ secrets.OSSRH_USERNAME }}
PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
BUILD_ID: ${{ steps.spell.outputs.version }}