From 86fbb941445ba9b7a297e6802ad707e81cc3b1d4 Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 13 Nov 2023 12:35:27 -0800 Subject: [PATCH] feat: publish PackageSet on Fluvio Publish (#3694) * feat: publish PackageSet on Fluvio Publish * feat: use makefile instead * fix: bump version along with publish pkgset * Update actions/publish-pkgset.sh Co-authored-by: T.J. Telan * fix: set static value on very top --------- Co-authored-by: T.J. Telan --- .github/workflows/publish.yml | 2 ++ actions/publish-pkgset.sh | 33 +++++++++++++++++++++++++++++++++ makefiles/release.mk | 13 ++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 actions/publish-pkgset.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f688cb66fa..9f238b1e85 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,8 +77,10 @@ jobs: - name: Publish artifacts env: + BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} FLUVIO_BIN: ~/.fluvio/bin/fluvio run: make publish-artifacts-dev + - name: Slack Notification uses: 8398a7/action-slack@v3 if: failure() diff --git a/actions/publish-pkgset.sh b/actions/publish-pkgset.sh new file mode 100755 index 0000000000..1c8e1d0c47 --- /dev/null +++ b/actions/publish-pkgset.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -u + +curl -v -X "POST" "https://hub.infinyon.cloud/hub/v1/fvm/pkgset" \ + -H "Authorization: $BPKG_TOKEN" \ + -H 'Content-Type: application/json; charset=utf-8' \ + --data-binary @- << EOF +{ + "artifacts": [ + { + "name": "fluvio", + "version": "$FLUVIO_VERSION" + }, + { + "name": "fluvio-cloud", + "version": "$FLUVIO_CLOUD_VERSION" + }, + { + "name": "fluvio-run", + "version": "$FLUVIO_VERSION" + }, + { + "name": "cdk", + "version": "$FLUVIO_VERSION" + }, + { + "name": "smdk", + "version": "$FLUVIO_VERSION" + } + ], + "pkgset": "$PKGSET_NAME" +} +EOF \ No newline at end of file diff --git a/makefiles/release.mk b/makefiles/release.mk index d46ed12260..1f3e51313d 100644 --- a/makefiles/release.mk +++ b/makefiles/release.mk @@ -58,6 +58,9 @@ TARGET?= PACKAGE?= ARTIFACT?= +# Fluvio Cloud Version used to publish pkgsets +FLUVIO_CLOUD_VERSION="0.2.15" + #### Testing only get-version: @@ -171,7 +174,7 @@ publish-artifacts: install-fluvio-package unzip-gh-release-artifacts $$ARTIFACT; \ ) -publish-artifacts: PUBLIC_VERSION=$(subst -$(GIT_COMMIT_SHA),+$(GIT_COMMIT_SHA),$(VERSION)) +publish-artifacts-hub: PUBLIC_VERSION=$(subst -$(GIT_COMMIT_SHA),+$(GIT_COMMIT_SHA),$(VERSION)) publish-artifacts-hub: unzip-gh-release-artifacts @echo "Publish to hub" $(foreach bin, $(PUBLISH_BINARIES_HUB), \ @@ -213,10 +216,18 @@ bump-fluvio: install-fluvio-package bump-fluvio-stable: CHANNEL_TAG=stable bump-fluvio-stable: VERSION=$(REPO_VERSION) bump-fluvio-stable: bump-fluvio + export PKGSET_NAME=$(VERSION) + export FLUVIO_VERSION=$(VERSION) + export FLUVIO_CLOUD_VERSION=$(FLUVIO_CLOUD_VERSION) + ./actions/publish-pkgset.sh bump-fluvio-latest: CHANNEL_TAG=latest bump-fluvio-latest: VERSION=$(subst -$(GIT_COMMIT_SHA),+$(GIT_COMMIT_SHA),$(DEV_VERSION_TAG)) bump-fluvio-latest: bump-fluvio + export PKGSET_NAME=$(VERSION) + export FLUVIO_VERSION=$(VERSION) + export FLUVIO_CLOUD_VERSION=$(FLUVIO_CLOUD_VERSION) + ./actions/publish-pkgset.sh update-public-installer-script-s3: $(DRY_RUN_ECHO) aws s3 cp ./install.sh s3://packages.fluvio.io/v1/install.sh --acl public-read