blob: 7e409a5d42df10fde0d880f1d7d64f48f6028a7e [file] [log] [blame]
Joey Armstrong4d612a92024-04-24 15:30:49 -04001#!/usr/bin/env bash
2# -----------------------------------------------------------------------
3# Copyright 2018-2024 Open Networking Foundation Contributors
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# -----------------------------------------------------------------------
17# SPDX-FileCopyrightText: 2018-2024 Open Networking Foundation Contributors
18# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
20# Intent:
21# builds (with make) and uploads release artifacts (binaries, etc.) to github
22# given a tag also create checksums files and release notes from the commit
23# message
24# -----------------------------------------------------------------------
25
26## ---------------------------------------------------------------------------
27## Intent: Display program usage
28## ---------------------------------------------------------------------------
29function usage()
30{
31 cat <<EOH
32
33Usage: $0
34Usage: make [options] [target] ...
35 --help This mesage
36 --pac Personal Access Token (path to containing file or a string)
37 --repo-name ex: voltctl
38 --repo-org ex: opencord
39 --release-notes [f] Release notes are passed by file argument
40
41[DEBUG]
42 --gen-version Generate a random release version string.
43 --git-hostname Git server hostname (default=github.com)
44 --version-file [f] Read version string from local version file (vs env var)
45 Assume ./VERSION if [f] not passed
46[MODES]
47 --debug Enable script debug mode
48 --draft Create a draft release (vs published)
49 --dry-run Simulation mode
50 --todo Display future enhancement list
51
52All other arguments are pass-through to the gh command.
53
54Usage: $0 --draft --repo-org opencord --repo-name voltctl --git-hostname github.com --pac ~/access.pac
55
56# Troubleshoot credentials:
57Usage: $0 --pac ~/.access.pac --verify
58
59EOH
60
61 return
62}
63
64: # assign $?=0 for source $script
65
66# [EOF]