-
Notifications
You must be signed in to change notification settings - Fork 143
80 lines (73 loc) · 2.73 KB
/
node-flow-deploy-preview.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
##
# Copyright (C) 2023-2024 Hedera Hashgraph, LLC
#
# 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: "Node: Deploy Preview"
on:
workflow_dispatch:
inputs:
tag-to-deploy:
description: "Version/Tag to Deploy (eg: v0.41.0 or 0.41.1):"
type: string
required: true
dry-run-enabled:
description: "Perform Dry Run"
type: boolean
required: false
default: false
defaults:
run:
shell: bash
jobs:
prepare-deploy-preview:
name: Prepare for Deploy
runs-on: network-node-linux-medium
outputs:
version: ${{ steps.tag.outputs.version }}
prerelease: ${{ steps.tag.outputs.prerelease }}
steps:
- name: Install Semantic Version Tools
run: |
echo "::group::Download SemVer Binary"
sudo curl -L -o /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
echo "::endgroup::"
echo "::group::Change SemVer Binary Permissions"
sudo chmod -v +x /usr/local/bin/semver
echo "::endgroup::"
echo "::group::Show SemVer Binary Version Info"
semver --version
echo "::endgroup::"
- name: Extract Tag Version
id: tag
run: |
RELEASE_VERSION="$(semver get release "${{ github.event.inputs.tag-to-deploy }}")"
PRERELEASE_VERSION="$(semver get prerel "${{ github.event.inputs.tag-to-deploy }}")"
FINAL_VERSION="${RELEASE_VERSION}"
PRERELEASE_FLAG="false"
[[ -n "${PRERELEASE_VERSION}" ]] && FINAL_VERSION="${RELEASE_VERSION}-${PRERELEASE_VERSION}"
[[ -n "${PRERELEASE_VERSION}" ]] && PRERELEASE_FLAG="true"
echo "version=${FINAL_VERSION}" >>"${GITHUB_OUTPUT}"
echo "prerelease=${PRERELEASE_FLAG}" >>"${GITHUB_OUTPUT}"
deploy-tag:
name: Deploy Tag
uses: ./.github/workflows/node-zxc-deploy-preview.yaml
needs:
- prepare-deploy-preview
with:
version-policy: specified
new-version: ${{ needs.prepare-deploy-preview.outputs.version }}
secrets:
access-token: ${{ secrets.GITHUB_TOKEN }}
bucket-name: ${{ secrets.RELEASE_ARTIFACT_BUCKET_NAME }}
jenkins-preview-url: ${{ secrets.RELEASE_JENKINS_PREVIEW_URL }}