From d5ff425ffcc5c1567567dc52ee191fc9eb8bdd4d Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Wed, 22 May 2024 10:43:37 +0200 Subject: [PATCH] init7 --- .github/workflows/build-and-upload.yaml | 59 ++++++++++++++++++- .../{drone-build-pkg.sh => ci-build-pkg.sh} | 8 +-- 2 files changed, 61 insertions(+), 6 deletions(-) rename shell/scripts/{drone-build-pkg.sh => ci-build-pkg.sh} (80%) diff --git a/.github/workflows/build-and-upload.yaml b/.github/workflows/build-and-upload.yaml index 1aacc4d95ee..13172089ed4 100644 --- a/.github/workflows/build-and-upload.yaml +++ b/.github/workflows/build-and-upload.yaml @@ -77,7 +77,7 @@ jobs: - id: upload-gate name: Upload Gate (superseded by a newer build?) run: ./scripts/build-upload-gate - + # - name: Get gcs auth # uses: rancher-eio/read-vault-secrets@main # with: @@ -146,5 +146,60 @@ jobs: # cache-control: no-cache,must-revalidate # process_gcloudignore: false + build-and-upload-harvester-plugin: + name: Build & Upload Harvester Plugin + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + # Note - Cannot use the setup action here as it uses a different yarn install arg + - uses: actions/setup-node@v3 + with: + node-version: '14.x' + cache: 'yarn' + + - id: build-pkg + name: Build pkg + run: ./shell/scripts/ci-build-pkg.sh harvester + + - id: upload-gate + name: Upload Gate + run: ./scripts/build-upload-gate - \ No newline at end of file + # - name: Get gcs auth + # uses: rancher-eio/read-vault-secrets@main + # with: + # secrets: | + # secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH + + # - name: Apply gcs auth + # # https://github.com/google-github-actions/auth + # uses: 'google-github-actions/auth@v2' + # with: + # credentials_json: "${{ env.GOOGLE_AUTH }}" + + # - name: Upload tar + # uses: 'google-github-actions/upload-cloud-storage@v2' + # with: + # path: ${{steps.build-embedded.outputs.BUILD_EMBEDED_TGZ}} + # # Example - https://releases.rancher.com/harvester-ui/ui/2.8.0.tar.gz + # destination: releases.rancher.com/harvester-ui/${{ env.REPO }} + # parent: false + # headers: |- + # cache-control: no-cache,must-revalidate + # process_gcloudignore: false + + + # - name: + # pull: default + # image: plugins/gcs + # settings: + # acl: + # - allUsers:READER + # cache_control: "no-cache,must-revalidate" + # source: dist-pkg/${PKG_TARBALL} + # target: releases.rancher.com/harvester-ui/plugin/${PKG_TARBALL} + # token: + # from_secret: google_auth_key \ No newline at end of file diff --git a/shell/scripts/drone-build-pkg.sh b/shell/scripts/ci-build-pkg.sh similarity index 80% rename from shell/scripts/drone-build-pkg.sh rename to shell/scripts/ci-build-pkg.sh index b458cffa35a..0d4c4a16994 100755 --- a/shell/scripts/drone-build-pkg.sh +++ b/shell/scripts/ci-build-pkg.sh @@ -10,17 +10,17 @@ else VERSION=$COMMIT_BRANCH fi -echo "DRONE_TAG: ${DRONE_TAG}" +echo "CI_BUILD_TAG: ${CI_BUILD_TAG}" echo "GIT_TAG: ${GIT_TAG}" echo "TAG_VERSION: ${TAG_VERSION}" -echo "Drone Build Args" +echo "CI Build Args" echo "COMMIT: ${COMMIT}" echo "COMMIT_BRANCH: ${COMMIT_BRANCH}" echo "VERSION: ${VERSION}" if [ -n "$GIT_TAG" ]; then - COMMIT=$COMMIT COMMIT_BRANCH=$COMMIT_BRANCH VERSION=$DRONE_TAG ./shell/scripts/build-pkg.sh ${1} "true" + COMMIT=$COMMIT COMMIT_BRANCH=$COMMIT_BRANCH VERSION=$CI_BUILD_TAG ./shell/scripts/build-pkg.sh ${1} "true" else COMMIT=$COMMIT COMMIT_BRANCH=$COMMIT_BRANCH VERSION=$VERSION ./shell/scripts/build-pkg.sh ${1} "true" fi @@ -33,7 +33,7 @@ export PKG_TARBALL=${PKG_NAME}.tar.gz export PKG_TAG_VERSION=${1}-${TAG_VERSION} export PKG_TAG_TARBALL=${TAG_VERSION}.tar.gz -echo "Drone Build Artefacts" +echo "CI Build Artefacts" echo "Package Directory: ${PKG_NAME}" echo "Package Tarball: ${PKG_TARBALL}" echo "Tag Package: ${PKG_TAG_VERSION} ${PKG_TAG_TARBALL}"