Skip to content

chore(deps): bump the go_modules group across 1 directory with 2 upda… #643

chore(deps): bump the go_modules group across 1 directory with 2 upda…

chore(deps): bump the go_modules group across 1 directory with 2 upda… #643

---
# Releases a pre-release chart and the charts
# that depend on it. It is triggered by
# The PR workflow. The PR workflow will first run any and all tests
# that it has to. If the tests are successful,create a new RC-stamped
# chart to use for internal environments.
name: Release Pre-release charts
on:
workflow_call:
secrets:
REPO_GOOGLE_WORKLOAD_IDP:
required: true
WD_HCI_FG_PAT:
required: true
CROSS_REPOSITORY_REPOSITORY:
required: true
CROSS_REPOSITORY_WORKFLOW:
required: true
push:
branches:
- release/*
- release-next
jobs:
pre-release:
permissions:
contents: write
id-token: write
env:
GCP_HELM_REGISTRY: helm-internal
GCP_LOCATION: us-central1
GCP_PROJECT: computer-vision-team
GCP_SERVICE_ACCOUNT: github@computer-vision-team.iam.gserviceaccount.com
HELM_CHART_NAME: fiftyone-teams-app
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
# If a pull request, checkout the source branch
# If a push, checkout the actual branch
ref: "${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}"
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set Helm Chart Version
id: find-versions
run: |
version=$(yq ".version" helm/fiftyone-teams-app/Chart.yaml)
sha="$(git rev-parse --short HEAD)"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# If this was triggered via a pull_request and then workflow_call.
# The workflow is triggered by pull_request, not workflow_call,
# which is why the above conditional uses the event name pull_request.
# In this case, it is a development branch, so mark it as a
# sha build.
version="${version}-sha-${sha}"
elif [[ "${{ github.event_name }}" == "push" ]]; then
# After the PR is merged, a push event is triggered to
# the branch. So mark it as an rc build.
version="${version}-rc-${sha}"
else
# This isn't really needed but, in my opinion, adds clarity
# to the above two conditionals.
echo "This was triggered by ${{ github.event.name }}. Exiting..."
exit 1
fi
echo "Triggered via ${{ github.event_name }}. Setting version to ${version}"
echo "FIFTYONE_TEAMS_APP_DEPLOY_VERSION=${version}" >> "${GITHUB_ENV}"
- name: Install Helm
uses: azure/setup-helm@v5
with:
version: latest
- name: Set Up Cloud SDK
uses: google-github-actions/setup-gcloud@v3
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
project_id: ${{ env.GCP_PROJECT }}
service_account: ${{ env.GCP_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.REPO_GOOGLE_WORKLOAD_IDP }}
- name: Helm login to Google Artifact Registry
run: |
gcloud auth print-access-token | \
helm registry login \
-u oauth2accesstoken \
--password-stdin \
"${GCP_LOCATION}-docker.pkg.dev"
- name: Update Charts
run: |
yq --inplace ".version = \"${{ env.FIFTYONE_TEAMS_APP_DEPLOY_VERSION }}\"" "Chart.yaml"
working-directory: "helm/fiftyone-teams-app"
- name: Helm publish chart to artifact registry
run: |
helm package "${{ env.HELM_CHART_NAME }}"
helm push "${{ env.HELM_CHART_NAME }}-${{ env.FIFTYONE_TEAMS_APP_DEPLOY_VERSION }}.tgz" oci://${{ env.GCP_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT }}/${{ env.GCP_HELM_REGISTRY }}/
working-directory: "helm"
- name: Trigger Internal Chart Build
uses: actions/github-script@v9
with:
github-token: ${{ secrets.WD_HCI_FG_PAT }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: "${{ github.repository_owner }}",
repo: "${{ secrets.CROSS_REPOSITORY_REPOSITORY }}",
workflow_id: "${{ secrets.CROSS_REPOSITORY_WORKFLOW }}",
ref: "main",
inputs: {
"fiftyone-teams-app-deploy-version": "${{ env.FIFTYONE_TEAMS_APP_DEPLOY_VERSION }}"
}
})