Skip to content

Commit

Permalink
Add some artifacthub.io annotations to Helm charts (#4003)
Browse files Browse the repository at this point in the history
See https://artifacthub.io/docs/topics/annotations/helm/
We may add support for more annotations in the future, but this seems
like a good place to start (all annotations are optional).

For #3979

Signed-off-by: Antonin Bas <abas@vmware.com>
  • Loading branch information
antoninbas committed Jul 15, 2022
1 parent 675c015 commit 4b788e7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/golicense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ on:
- release-*
- feature/*
release:
types:
- created
types: [published]

jobs:
check-changes:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/process_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Process new release

on:
release:
types:
- created
types: [published]

jobs:
upload-release-assets:
Expand All @@ -17,6 +16,7 @@ jobs:
- name: Build assets
env:
TAG: ${{ github.ref }}
PRERELEASE: ${{ github.event.release.prerelease }}
run: |
mkdir assets
VERSION="${TAG:10}" ./hack/release/prepare-assets.sh ./assets
Expand Down
4 changes: 4 additions & 0 deletions build/charts/antrea/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ keywords:
- OVS
sources:
- https://github.com/antrea-io/antrea
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/operator: "false"
artifacthub.io/prerelease: "false"
4 changes: 4 additions & 0 deletions build/charts/flow-aggregator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ keywords:
- Flow Aggregator
sources:
- https://github.com/antrea-io/antrea
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/operator: "false"
artifacthub.io/prerelease: "false"
9 changes: 9 additions & 0 deletions hack/generate-helm-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,18 @@ elif ! $HELM version > /dev/null 2>&1; then
fi

ANTREA_CHART="$THIS_DIR/../build/charts/antrea"
# create a backup file before making changes.
# note that the backup file will not be included in the release: .bak files are
# ignored as per the .helmignore file.
cp "$ANTREA_CHART/Chart.yaml" "$ANTREA_CHART/Chart.yaml.bak"
yq -i '.annotations."artifacthub.io/prerelease" = strenv(PRERELEASE)' "$ANTREA_CHART/Chart.yaml"
$HELM package --app-version $VERSION --version $VERSION $ANTREA_CHART
mv "antrea-$VERSION.tgz" "$OUT/antrea-chart.tgz"
mv "$ANTREA_CHART/Chart.yaml.bak" "$ANTREA_CHART/Chart.yaml"

FLOW_AGGREGATOR_CHART="$THIS_DIR/../build/charts/flow-aggregator"
cp "$FLOW_AGGREGATOR_CHART/Chart.yaml" "$FLOW_AGGREGATOR_CHART/Chart.yaml.bak"
yq -i '.annotations."artifacthub.io/prerelease" = strenv(PRERELEASE)' "$FLOW_AGGREGATOR_CHART/Chart.yaml"
$HELM package --app-version $VERSION --version $VERSION $FLOW_AGGREGATOR_CHART
mv "flow-aggregator-$VERSION.tgz" "$OUT/flow-aggregator-chart.tgz"
mv "$FLOW_AGGREGATOR_CHART/Chart.yaml.bak" "$FLOW_AGGREGATOR_CHART/Chart.yaml"
9 changes: 9 additions & 0 deletions hack/release/prepare-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# This script generates all the assets required for an Antrea Github release to
# the provided directory.
# Usage: VERSION=v1.0.0 ./prepare-assets.sh <output dir>
# In addition to the VERSION environment variable (which is required), the
# PRERELEASE environment variable can also be set to true or false (it will
# default to false).

set -eo pipefail

Expand All @@ -33,6 +36,12 @@ if [ -z "$1" ]; then
echoerr "Argument required: output directory for assets"
fi

: "${PRERELEASE:=false}"
if [ "$PRERELEASE" != "true" ] && [ "$PRERELEASE" != "false" ]; then
echoerr "Environment variable PRERELEASE should only be set to 'true' or 'false'"
fi
export PRERELEASE

THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

pushd $THIS_DIR/../.. > /dev/null
Expand Down

0 comments on commit 4b788e7

Please sign in to comment.