From d685abb6644200214f7d646ddd995ef89553b572 Mon Sep 17 00:00:00 2001 From: Marcelo Serpa <81248+fullofcaffeine@users.noreply.github.com> Date: Tue, 14 Mar 2023 17:43:31 -0600 Subject: [PATCH] Revert debug changes Revert changes I made in order to test end-to-end from a test fork. --- .github/workflows/build-plugin-zip.yml | 43 ++++++++++++++++++- .../upload-release-to-plugin-repo.yml | 14 ++---- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index bac19ebcd2e46..e86123051b118 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -71,7 +71,7 @@ jobs: - name: Checkout code uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GUTENBERG_TOKEN }} - name: Compute old and new version id: get_version @@ -298,3 +298,44 @@ jobs: asset_path: ./gutenberg.zip asset_name: gutenberg.zip asset_content_type: application/zip + + npm-publish: + name: Publish WordPress packages to npm + runs-on: ubuntu-latest + environment: WordPress packages + needs: [bump-version, build] + if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }} + steps: + - name: Checkout (for CLI) + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + path: main + ref: trunk + + - name: Checkout (for publishing) + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + path: publish + # Later, we switch this branch in the script that publishes packages. + ref: trunk + token: ${{ secrets.GUTENBERG_TOKEN }} + + - name: Configure git user name and email (for publishing) + run: | + cd publish + git config user.name "Gutenberg Repository Automation" + git config user.email gutenberg@wordpress.org + + - name: Setup Node.js + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + with: + node-version-file: 'main/.nvmrc' + registry-url: 'https://registry.npmjs.org' + + - name: Publish packages to npm ("latest" dist-tag) + run: | + cd main + npm ci + ./bin/plugin/cli.js npm-latest --semver minor --ci --repository-path ../publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 2d7bbbe91420b..aab86ae9062d9 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -12,8 +12,7 @@ jobs: latest_stable_tag: ${{ steps.get_latest_stable_tag.outputs.latest_stable_tag }} steps: - - uses: hmarr/debug-action@v2 - - name: Get latest stable ta + - name: Get latest stable tag id: get_latest_stable_tag run: | curl \ @@ -30,7 +29,6 @@ jobs: release_branch: ${{ steps.get_release_branch.outputs.release_branch }} steps: - - uses: hmarr/debug-action@v2 - name: Compute release branch name id: get_release_branch env: @@ -57,12 +55,11 @@ jobs: label: release steps: - - uses: hmarr/debug-action@v2 - name: Checkout code uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: ref: ${{ matrix.branch }} - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GUTENBERG_TOKEN }} - name: Update the Changelog to include the release notes run: | @@ -123,14 +120,13 @@ jobs: endsWith( github.ref, needs.compute-latest-stable.outputs.latest_stable_tag ) && !github.event.release.prerelease && github.event.release.assets[0] env: - PLUGIN_REPO_URL: 'http://caffeine.ngrok.io/svn/gutenberg' + PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg' STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*' SVN_USERNAME: ${{ secrets.svn_username }} SVN_PASSWORD: ${{ secrets.svn_password }} VERSION: ${{ github.event.release.name }} steps: - - uses: hmarr/debug-action@v2 - name: Check out Gutenberg trunk from WP.org plugin repo run: svn checkout "$PLUGIN_REPO_URL/trunk" --username "$SVN_USERNAME" --password "$SVN_PASSWORD" @@ -188,15 +184,13 @@ jobs: !endsWith( github.ref, needs.compute-latest-stable.outputs.latest_stable_tag ) && !github.event.release.prerelease && github.event.release.assets[0] env: - PLUGIN_REPO_URL: 'http://caffeine.ngrok.io/svn/gutenberg' + PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg' STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*' SVN_USERNAME: ${{ secrets.svn_username }} SVN_PASSWORD: ${{ secrets.svn_password }} VERSION: ${{ github.event.release.name }} steps: - - uses: hmarr/debug-action@v2 - - name: Check out Gutenberg branches from WP.org plugin repo run: svn checkout "$PLUGIN_REPO_URL/branches" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"