From cdc11bc6fe56a14c4ba238ca84b61d7a3ff9eb5e Mon Sep 17 00:00:00 2001 From: sulhicader Date: Mon, 20 Nov 2023 06:06:44 +0530 Subject: [PATCH] Attached new flows to publish-university --- ...ease.yaml => helm-release-university.yaml} | 11 ++++--- .github/workflows/publish-university.yml | 31 +++++-------------- ...undle.yaml => wave-bundle-university.yaml} | 8 ++--- ...lish.yaml => wave-publish-university.yaml} | 11 ++++--- .github/workflows/wave-university.yaml | 30 ++++++++++++++++++ .github/workflows/wave.yaml | 26 ---------------- 6 files changed, 55 insertions(+), 62 deletions(-) rename .github/workflows/{helm-release.yaml => helm-release-university.yaml} (68%) rename .github/workflows/{wave-bundle.yaml => wave-bundle-university.yaml} (87%) rename .github/workflows/{wave-publish.yaml => wave-publish-university.yaml} (67%) create mode 100644 .github/workflows/wave-university.yaml delete mode 100644 .github/workflows/wave.yaml diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release-university.yaml similarity index 68% rename from .github/workflows/helm-release.yaml rename to .github/workflows/helm-release-university.yaml index 6aab5970d7..46978c21fc 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release-university.yaml @@ -2,12 +2,15 @@ name: Release Generated Helm Chart on: workflow_call: + inputs: + build-version: + type: string + description: The version of the application/image to be pushed + required: true jobs: retrieve-metadata: runs-on: ubuntu-latest - outputs: - build-version: ${{ steps.get-build-version.outputs.VERSION }} steps: - uses: actions/checkout@v3 @@ -15,7 +18,7 @@ jobs: - name: Get App Version id: get-build-version run: | - echo "VERSION=0.0.1" >> "$GITHUB_OUTPUT" + echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" release-helm-chart: needs: retrieve-metadata @@ -25,6 +28,6 @@ jobs: uses: ./.github/workflows/wave-bundle-helm-release.yaml with: - build-version: ${{ needs.retrieve-metadata.outputs.build-version }} + build-version: ${{ inputs.build-version }} helm-chart-artifact: wave-bundle-helm wave-app-name: university diff --git a/.github/workflows/publish-university.yml b/.github/workflows/publish-university.yml index 20df752b07..2f1978a55e 100644 --- a/.github/workflows/publish-university.yml +++ b/.github/workflows/publish-university.yml @@ -1,30 +1,15 @@ name: Publish Wave University on: - workflow_dispatch: - inputs: - version: - description: 'Release Version' - required: true + push: + -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: "${{ github.event.inputs.version }}" jobs: - publish: - name: Publish Wave University - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GIT_TOKEN }} - - name: Build university - run: make publish-university - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - packages_dir: university/dist - password: ${{ secrets.PYPI_UNIVERSITY_TOKEN }} + bundle_generator: + name: Bundle and Publish + runs-on: ubuntu-20.04 + uses: ./.github/workflows/wave-university.yaml + with: + build-version: 1.0.0 diff --git a/.github/workflows/wave-bundle.yaml b/.github/workflows/wave-bundle-university.yaml similarity index 87% rename from .github/workflows/wave-bundle.yaml rename to .github/workflows/wave-bundle-university.yaml index 34d46005b8..111e9a204e 100644 --- a/.github/workflows/wave-bundle.yaml +++ b/.github/workflows/wave-bundle-university.yaml @@ -12,8 +12,6 @@ jobs: airgapped: name: Create Wave Bundle runs-on: ubuntu-latest - outputs: - build-version: ${{ steps.get-build-version.outputs.VERSION }} steps: - uses: actions/checkout@v3 @@ -28,12 +26,12 @@ jobs: - name: Set version working-directory: ./university - run: sed -i -r -e "s/\{\{VERSION\}\}/0.0.1/g" app.toml + run: sed -i -r -e "s/\{\{VERSION\}\}/${{ inputs.build-version }}/g" app.toml - name: Get App Version id: get-build-version run: | - echo "VERSION=0.0.1" >> "$GITHUB_OUTPUT" + echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" - name: Make air-gapped bundle working-directory: ./university @@ -42,7 +40,7 @@ jobs: --docker-base-image 524466471676.dkr.ecr.us-east-1.amazonaws.com/q8s/launcher:v0.23.0-38 \ --docker-use-buildkit \ --generate-helm-charts \ - --helm-chart-version 0.0.1 \ + --helm-chart-version ${{ inputs.build-version }} \ --helm-chart-name university \ --helm-app-bundle-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/university-bundle \ --helm-app-runtime-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/university \ diff --git a/.github/workflows/wave-publish.yaml b/.github/workflows/wave-publish-university.yaml similarity index 67% rename from .github/workflows/wave-publish.yaml rename to .github/workflows/wave-publish-university.yaml index 050df02e25..65c091a744 100644 --- a/.github/workflows/wave-publish.yaml +++ b/.github/workflows/wave-publish-university.yaml @@ -2,12 +2,15 @@ name: Publish Wave Bundle on: workflow_call: + inputs: + build-version: + type: string + description: The version of the application/image to be pushed + required: true jobs: retrieve-metadata: runs-on: ubuntu-latest - outputs: - build-version: ${{ steps.get-build-version.outputs.VERSION }} steps: - uses: actions/checkout@v3 @@ -15,7 +18,7 @@ jobs: - name: Get App Version id: get-build-version run: | - echo "VERSION=0.0.1" >> "$GITHUB_OUTPUT" + echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" build-and-publish: needs: retrieve-metadata @@ -25,6 +28,6 @@ jobs: uses: ./.github/workflows/wave-bundle-docker-build-publish.yaml with: - build-version: ${{ needs.retrieve-metadata.outputs.build-version }} + build-version: ${{ inputs.build-version }} bundle-artifact: wave-bundle wave-app-name: university diff --git a/.github/workflows/wave-university.yaml b/.github/workflows/wave-university.yaml new file mode 100644 index 0000000000..89dab03308 --- /dev/null +++ b/.github/workflows/wave-university.yaml @@ -0,0 +1,30 @@ +name: Wave Bundle + +on: + workflow_call: + inputs: + build-version: + type: string + description: The version of the application/image to be pushed + required: true + +jobs: + bundle: + name: Create Wave Bundle + uses: ./.github/workflows/wave-bundle-university.yaml + with: + build-version: ${{ inputs.build-version }} + + publish: + needs: bundle + name: Build and Publish + uses: ./.github/workflows/wave-publish-university.yaml + with: + build-version: ${{ inputs.build-version }} + + helm-publish: + needs: bundle + name: Build and Publish Helm Chart + uses: ./.github/workflows/helm-release-university.yaml + with: + build-version: ${{ inputs.build-version }} diff --git a/.github/workflows/wave.yaml b/.github/workflows/wave.yaml deleted file mode 100644 index e04b9c009a..0000000000 --- a/.github/workflows/wave.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Wave Bundle - -on: - push: - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: "0.0.1" - TAG: "v0.0.1" - -jobs: - bundle: - name: Create Wave Bundle - uses: ./.github/workflows/wave-bundle.yaml - with: - build-version: 0.0.1 - - publish: - needs: bundle - name: Build and Publish - uses: ./.github/workflows/wave-publish.yaml - - helm-publish: - needs: bundle - name: Build and Publish Helm Chart - uses: ./.github/workflows/helm-release.yaml