-
Notifications
You must be signed in to change notification settings - Fork 77
48 lines (38 loc) · 1.43 KB
/
publish-releases.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
name: Publish releases
on: workflow_dispatch
permissions:
contents: write
packages: write
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build dockerBuildImage
- name: Publish example docker images
run: ./gradlew dockerPushImage
env:
ORG_GRADLE_PROJECT_DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
ORG_GRADLE_PROJECT_DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish maven artifacts
run: ./gradlew publish closeAndReleaseStagingRepositories
env:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Tag version
run: |
VERSION=$(./gradlew properties | grep "version:" | awk '{print $2}')
TAG="v$VERSION"
git tag "$TAG"
echo "Publishing tag"
git push origin "$TAG" || true # Do not fail, if the tag already exists