diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 8535a10230..0000000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Release Partner Charts - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Configure git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Update main-source branch - run: | - scripts/pull-ci-scripts - bin/partner-charts-ci auto - git push origin main-source - - - name: Create PR to update main branch - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_WORKFLOW: ${{ github.workflow }} - GITHUB_REPOSITORY: ${{ github.repository }} - run: | - # checkout action only fetches main-source, so we need to fetch main branch also - git fetch origin main --depth 1 - git checkout main - UPDATE_BRANCH="auto-update/$(date '+%s')" - git checkout -b "$UPDATE_BRANCH" - git rm -r assets index.yaml - git checkout main-source -- assets index.yaml - git commit -m "Update partner charts" - git push --set-upstream origin "$UPDATE_BRANCH" - TITLE="Update partner charts" - BODY="This PR was created by workflow \"$GITHUB_WORKFLOW\"." - gh pr create --repo "$GITHUB_REPOSITORY" --base main --head "$UPDATE_BRANCH" --title "$TITLE" --body "$BODY" diff --git a/.github/workflows/update-main-source.yml b/.github/workflows/update-main-source.yml new file mode 100644 index 0000000000..2fcc5b91f4 --- /dev/null +++ b/.github/workflows/update-main-source.yml @@ -0,0 +1,32 @@ +name: Auto-update charts + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Configure git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Update main-source branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_WORKFLOW: ${{ github.workflow }} + GITHUB_REPOSITORY: ${{ github.repository }} + run: | + scripts/pull-ci-scripts + BRANCH="auto-update/$(date '+%s')" + git checkout -b "$BRANCH" + bin/partner-charts-ci auto + git push --set-upstream origin "$BRANCH" + TITLE="Auto-update charts on main-source" + BODY="This PR was created by the \"$GITHUB_WORKFLOW\" workflow. It auto-updates the helm charts on the main-source branch." + gh pr create --repo "$GITHUB_REPOSITORY" --base main-source --head "$BRANCH" --title "$TITLE" --body "$BODY" diff --git a/.github/workflows/update-main.yml b/.github/workflows/update-main.yml new file mode 100644 index 0000000000..f761a5a779 --- /dev/null +++ b/.github/workflows/update-main.yml @@ -0,0 +1,29 @@ +name: Update main branch from main-source + +on: + workflow_dispatch: + push: + branches: + - main-source + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + + - name: Configure git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Update main branch with latest from main-source + run: | + # checkout action only fetches main, so we need to fetch main-source + git fetch origin main-source --depth 1 + git rm -r assets index.yaml + git checkout main-source -- assets index.yaml + git commit -m "Update partner charts" + git push origin