-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (135 loc) · 4.65 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
134
135
136
137
138
139
140
141
142
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# 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
#
# https://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: "Run release"
on:
workflow_call:
inputs:
client_type:
type: "string"
description: "Set client type. e.g) go, python, node, java, clj"
required: false
# If a workflow is executed in duplicate, the first workflow continues to be executed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
if: startsWith( github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if tag is a LATEST.
id: check_latest
run: |
TAG=$(echo "$GITHUB_REF" | sed -e 's:^refs/tags/::') # e.g) v1.7.6
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) # e.g) v1.7.6
echo "IS_LATEST_RELEASE=$([ "${TAG}" = "${LATEST_TAG}" ] && echo true || echo false)" | tee -a $GITHUB_OUTPUT
echo "TAG=${TAG}" | tee -a $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ steps.check_latest.outputs.TAG }}
tag_name: ${{ github.ref }}
draft: false
prerelease: false
make_latest: ${{ steps.check_latest.outputs.IS_LATEST_RELEASE }}
publish-pypl:
if: ${{ startsWith( github.ref, 'refs/tags/') && inputs.client_type == 'python'}}
runs-on: ubuntu-latest
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
options: "--add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: vdaas/vald-client-ci/.github/actions/setup-language@main
with:
client_type: python
- name: Install dependencies
run: |
make REPO=vdaas ci/deps/install
- name: Prepare for publish
run: |
make REPO=vdaas ci/package/prepare
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PIP_USERNAME }}
password: ${{ secrets.PIP_TOKEN }}
publish-npm:
if: ${{ startsWith( github.ref, 'refs/tags/') && inputs.client_type == 'node'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: vdaas/vald-client-ci/.github/actions/setup-language@main
with:
client_type: node
- name: Prepare for publish
run: |
make REPO=vdaas ci/package/prepare
- name: Publish
run: |
make REPO=vdaas ci/package/publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
publish-maven:
if: ${{ startsWith( github.ref, 'refs/tags/') && inputs.client_type == 'java'}}
runs-on: ubuntu-latest
env:
GPG_KEYID: ${{ secrets.GPG_KEYID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: vdaas/vald-client-ci/.github/actions/setup-language@main
with:
client_type: java
- name: Prepare for publish
run: |
make REPO=vdaas ci/package/prepare
- name: Publish
run: |
make REPO=vdaas ci/package/publish
publish-clojars:
if: ${{ startsWith( github.ref, 'refs/tags/') && inputs.client_type == 'clj'}}
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: actions/checkout@v4
- uses: vdaas/vald-client-ci/.github/actions/setup-language@main
with:
client_type: clj
- name: Prepare for publish
run: |
make REPO=vdaas ci/package/prepare
- name: Publish
run: |
make REPO=vdaas ci/package/publish
env:
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}