-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
86 lines (83 loc) · 3.6 KB
/
ci-publish-commit.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright 2022 JanusGraph Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI Release commit artifacts
on:
push:
branches:
- master
- v*
jobs:
commit-publish:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: "8.0.382+5"
java-package: jdk
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Github Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Remove version SNAPSHOT suffix if exists
run: mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
- name: Set JanusGraph version environment variable
run: |
export JG_VER="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$(date '+%Y%m%d-%H%M%S').$(git rev-parse --short HEAD)"
export JG_DESCRIPTION="Janusgraph commit release. Commit $(git rev-parse HEAD). Branch $(git rev-parse --abbrev-ref HEAD). Version $JG_VER."
export MULTI_PLATFORM="true"
echo "JG_VER=${JG_VER}" >> $GITHUB_ENV
echo "JG_DESCRIPTION=${JG_DESCRIPTION}" >> $GITHUB_ENV
echo "MULTI_PLATFORM=${MULTI_PLATFORM}" >> $GITHUB_ENV
- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Set OSSR credentials
run: |
mkdir -p ~/.m2/
echo "<settingsSecurity><master>$MASTER_PASSWORD</master></settingsSecurity>" > ~/.m2/settings-security.xml
echo "<settings><servers><server><id>ossrh</id><username>$OSSRH_USERNAME</username><password>$OSSRH_PASSWORD</password></server></servers></settings>" > ~/.m2/settings.xml
env:
MASTER_PASSWORD: ${{ secrets.MASTER_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Setup unique version
run: mvn versions:set -DnewVersion="$JG_VER" -DgenerateBackupPoms=false
- name: Make JanusGraph JAR artifacts
run: mvn clean install -Pjanusgraph-release -DskipTests=true
- name: Deploy JanusGraph JAR artifacts into staging repository
run: mvn deploy -Pjanusgraph-release,janusgraph-commit-release -DskipTests=true -DautoReleaseAfterClose=true -Ddescription="$JG_DESCRIPTION" -DstagingDescription="$JG_DESCRIPTION"