From 1004a9322c5e85293394ed60609e96144c8e88fc Mon Sep 17 00:00:00 2001 From: Adam Sulucz Date: Thu, 25 Sep 2025 16:33:45 -0400 Subject: [PATCH] Don't attempt to open PRs on releases --- .github/workflows/release.yml | 81 ----------------------------------- 1 file changed, 81 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76cfeac..b64303a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,98 +5,18 @@ permissions: pull-requests: write on: - workflow_dispatch: - inputs: - version: - description: Bump version - type: choice - required: true - options: [⚙️ patch (v1.0.1), 🧩 minor (v1.1.0), ⭐️ major (v2.0.0)] push: tags: - 'v*' run-name: ${{ github.event_name == 'workflow_dispatch' && format('Bump {0}', startsWith(inputs.version, '⚙️') && 'patch ⚙️' || startsWith(inputs.version, '🧩') && 'minor 🧩' || 'major ⭐️') || github.ref_name }} -env: - ⚙️ patch (v1.0.1): patch - 🧩 minor (v1.1.0): minor - ⭐️ major (v2.0.0): major - jobs: - release: - name: 🔖 Release - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - outputs: - RELEASE_REF: ${{ steps.bump-version.outputs.RELEASE_REF }} - RELEASE_TAG: ${{ steps.create-release-pr.outputs.RELEASE_TAG }} - steps: - - uses: actions/checkout@v4 - with: - ref: dev - fetch-depth: 0 - - - name: 🛤️ Version tag must be on dev branch - if: github.event_name == 'push' - run: git branch --contains ${{ github.ref }} | grep dev - - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - - name: ⬆️ Bump version - if: github.event_name == 'workflow_dispatch' - id: bump-version - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s" --no-push - - export VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//') - sed -E "s/^appVersion:.+$/appVersion: '$VERSION'/" -i install/kubernetes/github-actions-cache-server/Chart.yaml - git stage install/kubernetes/github-actions-cache-server/Chart.yaml - git commit -n --no-edit --amend - git tag -f "v$VERSION" - - git push origin dev - git push origin --tags - - echo "RELEASE_REF=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - - - name: 📥 Create release PR - id: create-release-pr - run: | - TAG_NAME=$(git describe --tags --abbrev=0) - echo "RELEASE_TAG=$TAG_NAME" >> "$GITHUB_OUTPUT" - RELEASE_BRANCH="release/$TAG_NAME" - echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> "$GITHUB_OUTPUT" - - git branch $RELEASE_BRANCH dev - git push origin $RELEASE_BRANCH - - gh pr create --title "$TAG_NAME" \ - --base master --head $RELEASE_BRANCH \ - --body "Automated pull request for tag $TAG_NAME" - - - name: 📢 Release - run: | - TAG=$(git describe --tags --abbrev=0) - RELEASE_BRANCH=${{ steps.create-release-pr.outputs.RELEASE_BRANCH }} - PR_NUMBER=$(gh pr view $RELEASE_BRANCH --json number --template "{{.number}}") - - gh pr merge $RELEASE_BRANCH --merge -t "$TAG (#$PR_NUMBER)" --body "" --delete-branch --admin - - npx changelogithub - deploy-docker: name: 🚀 Build and push Docker image permissions: packages: write contents: read - needs: [release] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -142,7 +62,6 @@ jobs: permissions: packages: write contents: read - needs: [release] runs-on: ubuntu-latest env: CHART_DIR: install/kubernetes/github-actions-cache-server