-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (119 loc) · 3.55 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
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
name: release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: |
-Prelease.useLastTag=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} test djobiAssemble
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: app
path: build/release
docker-package:
name: Package app as Docker image
runs-on: ubuntu-latest
needs: build
env:
REGISTRY: ghcr.io
IMAGE_NAME: datatok/djobi
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: actions/checkout@v2
- name: Download dist artifact
uses: actions/download-artifact@v2
id: distArtifacts
with:
name: app
path: build/release
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: packages/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDKIT_INLINE_CACHE=1
release-github:
name: Create github release
runs-on: ubuntu-latest
needs:
- build
- docker-package
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Download dist artifact
uses: actions/download-artifact@v2
id: distArtifacts
with:
name: app
path: build
- uses: montudor/action-zip@v1
with:
args: zip -qq -r build.zip build
- uses: ncipollo/release-action@v1
with:
artifacts: "build.zip"
body: |
Djobi release
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
publish-maven:
runs-on: ubuntu-latest
needs:
- build
- docker-package
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Publish package
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: |
-Prelease.useLastTag=true publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}