forked from JanusGraph/janusgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (132 loc) · 6.28 KB
/
ci-publish-official.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
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
134
135
136
137
138
# 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 official artifacts
on:
push:
tags:
- v*.*.*
jobs:
build-all:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- 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: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
architecture: x64
- name: Install pip3
run: sudo apt-get update && sudo apt-get install -y python3-pip
- name: Set JanusGraph versions environment variables
run: |
export RELEASE_TAG=${{github.ref_name}}
export JG_VER="${RELEASE_TAG//v/}"
export JG_DIST_NAME="janusgraph-${JG_VER}"
export JG_FULL_DIST_NAME="janusgraph-full-${JG_VER}"
export JG_DOC_DIST_NAME="${JG_DIST_NAME}-doc"
export MULTI_PLATFORM="true"
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
echo "JG_VER=${JG_VER}" >> $GITHUB_ENV
echo "JG_DIST_NAME=${JG_DIST_NAME}" >> $GITHUB_ENV
echo "JG_FULL_DIST_NAME=${JG_FULL_DIST_NAME}" >> $GITHUB_ENV
echo "JG_DOC_DIST_NAME=${JG_DOC_DIST_NAME}" >> $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 }}
# TODO: the step "Make JanusGraph JAR artifacts" should also create signature key for full JanusGraph bundle but for some
# reason it doesn't sign full distribution (only standard distribution).
# After this is fixed we can delete the step "Sign JanusGraph full distribution artifact".
- name: Make JanusGraph JAR artifacts
run: mvn clean install -Pjanusgraph-release -DskipTests=true
- name: Print content of the generated target directory for debugging purposes
run: echo $(ls janusgraph-dist/target/)
- name: Deploy JanusGraph JAR artifacts into staging repository
run: mvn deploy -Pjanusgraph-release -DskipTests=true
- name: Sign JanusGraph full distribution artifact
run: gpg --armor --detach-sign --yes janusgraph-dist/target/${JG_FULL_DIST_NAME}.zip
- name: Install requirements to build documentation
run: pip3 install -r requirements.txt
- name: Build documentation
run: mkdocs build
- name: Pack documentation into zip
run: |
mv site ${JG_DOC_DIST_NAME}
zip -r ${JG_DOC_DIST_NAME}.zip ${JG_DOC_DIST_NAME}
- name: Sign documentation artifact
run: gpg --armor --detach-sign ${JG_DOC_DIST_NAME}.zip
- name: Check distribution signature
run: gpg --verify janusgraph-dist/target/${JG_DIST_NAME}.zip.asc janusgraph-dist/target/${JG_DIST_NAME}.zip
- name: Check full distribution signature
run: gpg --verify janusgraph-dist/target/${JG_FULL_DIST_NAME}.zip.asc janusgraph-dist/target/${JG_FULL_DIST_NAME}.zip
- name: Check documentation signature
run: gpg --verify ${JG_DOC_DIST_NAME}.zip.asc ${JG_DOC_DIST_NAME}.zip
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
draft: true
tag: "${{ env.RELEASE_TAG }}"
artifacts: "KEYS,${{ env.JG_DOC_DIST_NAME }}.zip.asc,${{ env.JG_DOC_DIST_NAME }}.zip,janusgraph-dist/target/${{ env.JG_DIST_NAME }}.zip.asc,janusgraph-dist/target/${{ env.JG_DIST_NAME }}.zip,janusgraph-dist/target/${{ env.JG_FULL_DIST_NAME }}.zip.asc,janusgraph-dist/target/${{ env.JG_FULL_DIST_NAME }}.zip,target/bom.json,target/bom.xml"
name: "${{ env.JG_VER }}"
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
owner: janusgraph
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
# Version ${{ env.JG_VER }} (MM DD, YYYY)

Full documentation can be found at https://docs.janusgraph.org/
```xml
<dependency>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-core</artifactId>
<version>${{ env.JG_VER }}</version>
</dependency>
```
For more information on features and bug fixes in ${{env.JG_VER}}, see [this GitHub milestone](https://github.com/JanusGraph/janusgraph/milestone/*MILESTONE_NUMBER*?closed=1).