-
Notifications
You must be signed in to change notification settings - Fork 1.2k
124 lines (109 loc) · 3.79 KB
/
publish-release.yml
File metadata and controls
124 lines (109 loc) · 3.79 KB
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
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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: Publish Release
on:
push:
tags:
- "*"
jobs:
publish-jar:
name: Publish JAR
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup JDK 8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 8
server-id: apache.releases.https
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: maven
- name: Publish
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: |
./mvnw versions:set -Drevision=${{ github.ref_name }} -DgenerateBackupPoms=false
./mvnw deploy --batch-mode -DskipTests -Prelease -Dmaven.javadoc.skip=true -DretryFailedDeploymentCount=10
mv linkis-dist/target/apache-linkis-*-bin.tar.gz .
- name: Archive git repository
run: |
git archive --format=tar.gz -o apache-linkis-${{ github.ref_name }}-src.tar.gz --prefix=apache-linkis-${{ github.ref_name }}-src/ HEAD
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: jar
if-no-files-found: error
path: |
apache-linkis-*-src.tar.gz
apache-linkis-*-bin.tar.gz
publish-web:
name: Publish Web
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 16.x
cache: npm
cache-dependency-path: linkis-web/package-lock.json
- name: Build frontend by node.js
run: |
cd linkis-web
npm install
npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: web
if-no-files-found: error
path: |
linkis-web/apache-linkis-*-web-bin.tar.gz
create-release:
name: Create Release
runs-on: ubuntu-latest
needs:
- publish-jar
- publish-web
steps:
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Download artifact
uses: actions/download-artifact@v5
with:
merge-multiple: true
- name: Make signatures
run: |
for i in *.tar.gz; do echo $i; gpg --armor --output $i.asc --detach-sig $i ; done
for i in *.tar.gz; do echo $i; sha512sum $i > $i.sha512 ; done
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: Apache Linkis Release-${{ github.ref_name }}
draft: true
files: "*"