From 4cf4702904599337235334eb48ebf5f8e4d58254 Mon Sep 17 00:00:00 2001 From: Gauthier Petetin Date: Wed, 5 Mar 2025 17:24:16 -0300 Subject: [PATCH] fix(workflow): remove create-release-pr workflow --- .github/workflows/create-release-pr.yml | 57 ------------- scripts/create-release-pr.sh | 108 ------------------------ 2 files changed, 165 deletions(-) delete mode 100644 .github/workflows/create-release-pr.yml delete mode 100755 scripts/create-release-pr.sh diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml deleted file mode 100644 index ce37698ff0f2..000000000000 --- a/.github/workflows/create-release-pr.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Create Release Pull Request - -on: - workflow_dispatch: - inputs: - base-branch: - description: 'The base branch, tag, or SHA for git operations and the pull request.' - required: true - semver-version: - description: 'A semantic version. eg: x.x.x' - required: true - previous-version-tag: - description: 'Previous release version tag. eg: v7.7.0' - required: true -jobs: - generate-build-version: - uses: MetaMask/metamask-mobile-build-version/.github/workflows/metamask-mobile-build-version.yml@v0.2.0 - permissions: - id-token: write - - create-release-pr: - runs-on: ubuntu-latest - needs: generate-build-version - permissions: - contents: write - pull-requests: write - steps: - - uses: actions/checkout@v3 - with: - # This is to guarantee that the most recent tag is fetched. - # This can be configured to a more reasonable value by consumers. - fetch-depth: 0 - # We check out the specified branch, which will be used as the base - # branch for all git operations and the release PR. - ref: ${{ github.event.inputs.base-branch }} - # The last step of this workflow creates a release branch, which shall itself - # trigger another workflow: 'create-bug-report.yml'. However, there is a security - # feature in Github that prevents workflows from triggering other workflows by default. - # The workaround is to use a personal access token (BUG_REPORT_TOKEN) instead of - # the default GITHUB_TOKEN for the checkout action. - token: ${{ secrets.BUG_REPORT_TOKEN }} - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: yarn - - name: Install dependencies - run: yarn --immutable - - name: Create Release & Changelog PR - id: create-release-changelog-pr - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BASE_BRANCH: ${{ github.event.inputs.base-branch }} - run: | - ./scripts/create-release-pr.sh ${{ github.event.inputs.previous-version-tag }} ${{ github.event.inputs.semver-version }} ${{ needs.generate-build-version.outputs.build-version }} \ No newline at end of file diff --git a/scripts/create-release-pr.sh b/scripts/create-release-pr.sh deleted file mode 100755 index a7b4e09a3ec0..000000000000 --- a/scripts/create-release-pr.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u -set -o pipefail - -PREVIOUS_VERSION="${1}" -NEW_VERSION="${2}" -NEW_VERSION_NUMBER="${3}" -RELEASE_BRANCH_PREFIX="release/" - -if [[ -z $NEW_VERSION ]]; then - echo "Error: No new version specified." - exit 1 -fi - -RELEASE_BRANCH_NAME="${RELEASE_BRANCH_PREFIX}${NEW_VERSION}" -CHANGELOG_BRANCH_NAME="chore/${NEW_VERSION}-Changelog" -RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}. The changelog will be found in another PR ${CHANGELOG_BRANCH_NAME}. - - # Team sign-off checklist - - [ ] team-accounts - - [ ] team-assets - - [ ] team-confirmations - - [ ] team-design-system - - [ ] team-notifications - - [ ] team-platform - - [ ] team-security - - [ ] team-snaps-platform - - [ ] team-sdk - - [ ] team-stake - - [ ] team-tiger - - [ ] team-wallet-framework - - # Reference - - Testing plan sheet - https://docs.google.com/spreadsheets/d/1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ/edit?gid=404070372#gid=404070372" - -echo "Configuring git.." -git config user.name metamaskbot -git config user.email metamaskbot@users.noreply.github.com - -echo "Fetching from remote..." -git fetch - -# Check out the existing release branch from the remote -echo "Checking out the release branch: ${RELEASE_BRANCH_NAME}" -git checkout "${RELEASE_BRANCH_NAME}" - -echo "Release Branch Checked Out" - -echo "Running version update scripts.." -# Bump versions for the release -./scripts/set-semvar-version.sh "${NEW_VERSION}" -./scripts/set-build-version.sh "${NEW_VERSION_NUMBER}" - -echo "Adding and committing changes.." -# Track our changes -git add package.json android/app/build.gradle ios/MetaMask.xcodeproj/project.pbxproj bitrise.yml - -# Generate a commit -git commit -m "bump semvar version to ${NEW_VERSION} && build version to ${NEW_VERSION_NUMBER}" - -echo "Pushing changes to the remote.." -git push --set-upstream origin "${RELEASE_BRANCH_NAME}" - -echo Creating release PR.. - -gh pr create \ - --draft \ - --title "feat: ${NEW_VERSION}" \ - --body "${RELEASE_BODY}" \ - --head "${RELEASE_BRANCH_NAME}"; - -echo "Release PR Created" - - -echo "Checking out ${CHANGELOG_BRANCH_NAME}" -git checkout -b "${CHANGELOG_BRANCH_NAME}" -echo "Changelog Branch Created" - -#Generate changelog and test plan csv -echo "Generating changelog and test plan csv.." -node ./scripts/generate-rc-commits.mjs "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}" -./scripts/changelog-csv.sh "${RELEASE_BRANCH_NAME}" - -echo "Adding and committing changes.." -git add ./commits.csv - -if ! (git commit -am "updated changelog and generated feature test plan"); -then - echo "Error: No changes detected." - exit 1 -fi - -PR_BODY="This PR updates the change log for ${NEW_VERSION} and generates the test plan here [commit.csv](https://github.com/MetaMask/metamask-mobile/blob/${RELEASE_BRANCH_NAME}/commits.csv)" - -echo "Pushing changes to the remote.." -git push --set-upstream origin "${CHANGELOG_BRANCH_NAME}" - -echo Creating release PR.. -gh pr create \ - --draft \ - --title "chore: ${CHANGELOG_BRANCH_NAME}" \ - --body "${PR_BODY}" \ - --base "${RELEASE_BRANCH_NAME}" \ - --head "${CHANGELOG_BRANCH_NAME}"; - -echo "Changelog PR Created" \ No newline at end of file