Skip to content

GH Actions: Add action to upload release to SVN repo#27591

Merged
ockham merged 30 commits intomasterfrom
add/svn-upload-gh-action
Jan 4, 2021
Merged

GH Actions: Add action to upload release to SVN repo#27591
ockham merged 30 commits intomasterfrom
add/svn-upload-gh-action

Conversation

@ockham
Copy link
Copy Markdown
Contributor

@ockham ockham commented Dec 8, 2020

Description

Follows bin/plugin/commands/release.js.

The idea here is to couple the upload of the Gutenberg plugin to the WP.org plugin repo tightly to when a new release is published to GitHub, rather than running it from the local system of whoever's in charge of releasing that version.

Moving parts of the release workflow from locally running scripts to GH actions should overall make the process more easily reproducible, and should free up time and resources required for the release process.

The parts that would normally actually upload to the SVN repo are still commented out, since they need credentials -- I put a few echos instead. These credentials will need to be set as secrets in GitHub's settings.

If we want to merge this PR, we'll need to remove the parts from the local release script that are in charge of uploading to svn, so that we won't upload twice (once from the script, once from the GH action).

How has this been tested?

See here for an example run: https://github.com/ockham/gutenberg/runs/1643670225?check_suite_focus=true

Or use the following instructions to test for yourself:

  • Make sure you have your own fork of the Gutenberg repo, and that you've added it locally as a remote (E.g. git remote add ockham git@github.com:ockham/gutenberg.git if your GH username is ockham 🙂 ).
  • Check out this PR's branch, and push the contents to your fork's master branch (you can reset later):
git push ockham add/svn-upload-gh-action:master
  • Publish a release in your fork (under 'Releases', e.g. https://github.com/ockham/gutenberg/releases). Make sure to attach a gutenberg.zip as an asset (e.g. downloaded from the WP.org SVN plugin repo). For the release name, use a version number like 1.2.3 (with no leading v).
    • You might have to pick a tag to create the release for -- just choose any. If you're told that there already exists a release for each tag you try, create your own. (git tag v9.9.0-rc.1 and git push --tags ockham)
  • Go to the 'Actions' tab of your fork's GH page (e.g. https://github.com/ockham/gutenberg/actions).
  • Locate the action whose description reads "Upload Gutenberg plugin to WordPress.org plugin repo", and click on it.
  • It should only take a few seconds to perform the operations from this action.
  • Inspect the individual steps of the workflow (by expanding them) to verify that they worked.
  • Don't forget to clean up tags after running these commands, so you won't accidentally push tags that you solely created for testing to the actual Gutenberg repo later. See e.g. https://stackoverflow.com/questions/1841341/remove-local-git-tags-that-are-no-longer-on-the-remote-repository

(I've used my Gutenberg fork as an example, you can see the relevant action and release drafts from previous runs there.)

Screenshot

image

Types of changes

Build automation

Future ideas

Combine with #27488 for an even more automated release workflow

This PR covers the parts that happen after a GH release (with the plugin zipball attached as an asset) is released. I have a companion PR that covers the parts before: #27488 kicks in when a version tag is pushed to the repo. It builds the plugin zipball, creates a draft release, and attaches the plugin zipball as an asset. Merging both PRs could minimize the part of the release workflow that's done on a local machine to updating the changelog, and tagging.

Publish as reusable GH action

If this proves useful, it might make sense to publish it as a more generic GH action that looks for a zip asset attached to a release, and uploads it to the WP.org plugin repo. A similar action exists, but it has an important difference to this:

It uploads a snapshot of the files in the repo that correspond to a tag, rather than the files found in a zipball. Files can be excluded from upload via .gitignore and a .distignore. I'm not sure this sort of customizability is sufficient for GB, where we're more selective in picking our files. Generally, I think it's more versatile to use a zipball as the "input" for an action like this.

Furthermore, it's Docker-based, which I don't think is strictly necessary.

@ockham ockham added [Status] In Progress Tracking issues with work in progress [Type] Build Tooling Issues or PRs related to build tooling labels Dec 8, 2020
@ockham ockham self-assigned this Dec 8, 2020
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 8, 2020

Size Change: +34.2 kB (+3%)

Total Size: 1.28 MB

Filename Size Change
build/a11y/index.js 1.14 kB +133 B (+13%) ⚠️
build/annotations/index.js 3.81 kB +326 B (+9%) 🔍
build/api-fetch/index.js 3.42 kB +225 B (+7%) 🔍
build/autop/index.js 2.83 kB +231 B (+9%) 🔍
build/blob/index.js 665 B +151 B (+29%) 🚨
build/block-directory/index.js 8.71 kB +548 B (+7%) 🔍
build/block-editor/index.js 129 kB +3.74 kB (+3%)
build/block-library/index.js 149 kB +1.73 kB (+1%)
build/block-serialization-default-parser/index.js 1.88 kB +244 B (+15%) ⚠️
build/block-serialization-spec-parser/index.js 3.06 kB +292 B (+11%) ⚠️
build/blocks/index.js 48.1 kB +775 B (+2%)
build/components/index.js 170 kB +7.95 kB (+5%) 🔍
build/compose/index.js 11.2 kB +368 B (+3%)
build/core-data/index.js 15.2 kB +418 B (+3%)
build/data-controls/index.js 829 B +153 B (+23%) 🚨
build/data/index.js 8.98 kB +369 B (+4%)
build/date/index.js 31.8 kB +387 B (+1%)
build/deprecated/index.js 768 B +158 B (+26%) 🚨
build/dom-ready/index.js 571 B +153 B (+37%) 🚨
build/dom/index.js 4.95 kB +286 B (+6%) 🔍
build/edit-navigation/index.js 11.1 kB +546 B (+5%) 🔍
build/edit-post/index.js 306 kB +2.79 kB (+1%)
build/edit-site/index.js 24.5 kB +1.19 kB (+5%) 🔍
build/edit-widgets/index.js 26.3 kB +2.25 kB (+9%) 🔍
build/editor/index.js 42.8 kB +1.21 kB (+3%)
build/element/index.js 4.63 kB +409 B (+10%) ⚠️
build/escape-html/index.js 735 B +157 B (+27%) 🚨
build/format-library/index.js 6.75 kB +504 B (+8%) 🔍
build/hooks/index.js 2.27 kB +524 B (+30%) 🚨
build/html-entities/index.js 622 B +146 B (+31%) 🚨
build/i18n/index.js 3.57 kB +137 B (+4%)
build/is-shallow-equal/index.js 698 B +146 B (+26%) 🚨
build/keyboard-shortcuts/index.js 2.54 kB +313 B (+14%) ⚠️
build/keycodes/index.js 1.93 kB +261 B (+16%) ⚠️
build/list-reusable-blocks/index.js 3.11 kB +273 B (+10%) ⚠️
build/media-utils/index.js 5.31 kB +361 B (+7%) 🔍
build/notices/index.js 1.86 kB +252 B (+16%) ⚠️
build/nux/index.js 3.42 kB +353 B (+12%) ⚠️
build/plugins/index.js 2.54 kB +311 B (+14%) ⚠️
build/primitives/index.js 1.43 kB +217 B (+18%) ⚠️
build/priority-queue/index.js 789 B +153 B (+24%) 🚨
build/redux-routine/index.js 2.84 kB +161 B (+6%) 🔍
build/reusable-blocks/index.js 2.92 kB +240 B (+9%) 🔍
build/rich-text/index.js 13.4 kB +475 B (+4%)
build/server-side-render/index.js 2.77 kB +328 B (+13%) ⚠️
build/shortcode/index.js 1.7 kB +141 B (+9%) 🔍
build/token-list/index.js 1.27 kB +169 B (+15%) ⚠️
build/url/index.js 3.02 kB +298 B (+11%) ⚠️
build/viewport/index.js 1.86 kB +286 B (+18%) ⚠️
build/warning/index.js 1.14 kB +774 B (+213%) 🆘
build/wordcount/index.js 1.22 kB +156 B (+15%) ⚠️
ℹ️ View Unchanged
Filename Size Change
build/block-directory/style-rtl.css 943 B 0 B
build/block-directory/style.css 942 B 0 B
build/block-editor/style-rtl.css 11.3 kB 0 B
build/block-editor/style.css 11.2 kB 0 B
build/block-library/blocks/archives/editor-rtl.css 120 B 0 B
build/block-library/blocks/archives/editor.css 119 B 0 B
build/block-library/blocks/audio/editor-rtl.css 118 B 0 B
build/block-library/blocks/audio/editor.css 118 B 0 B
build/block-library/blocks/audio/style-rtl.css 152 B 0 B
build/block-library/blocks/audio/style.css 152 B 0 B
build/block-library/blocks/block/editor-rtl.css 211 B 0 B
build/block-library/blocks/block/editor.css 211 B 0 B
build/block-library/blocks/button/editor-rtl.css 513 B 0 B
build/block-library/blocks/button/editor.css 513 B 0 B
build/block-library/blocks/button/style-rtl.css 488 B 0 B
build/block-library/blocks/button/style.css 488 B 0 B
build/block-library/blocks/buttons/editor-rtl.css 275 B 0 B
build/block-library/blocks/buttons/editor.css 275 B 0 B
build/block-library/blocks/buttons/style-rtl.css 346 B 0 B
build/block-library/blocks/buttons/style.css 346 B 0 B
build/block-library/blocks/calendar/style-rtl.css 249 B 0 B
build/block-library/blocks/calendar/style.css 249 B 0 B
build/block-library/blocks/categories/editor-rtl.css 135 B 0 B
build/block-library/blocks/categories/editor.css 135 B 0 B
build/block-library/blocks/categories/style-rtl.css 132 B 0 B
build/block-library/blocks/categories/style.css 132 B 0 B
build/block-library/blocks/code/style-rtl.css 141 B 0 B
build/block-library/blocks/code/style.css 141 B 0 B
build/block-library/blocks/columns/editor-rtl.css 239 B 0 B
build/block-library/blocks/columns/editor.css 239 B 0 B
build/block-library/blocks/columns/style-rtl.css 467 B 0 B
build/block-library/blocks/columns/style.css 466 B 0 B
build/block-library/blocks/cover/editor-rtl.css 440 B 0 B
build/block-library/blocks/cover/editor.css 438 B 0 B
build/block-library/blocks/cover/style-rtl.css 1.27 kB 0 B
build/block-library/blocks/cover/style.css 1.27 kB 0 B
build/block-library/blocks/embed/editor-rtl.css 529 B 0 B
build/block-library/blocks/embed/editor.css 529 B 0 B
build/block-library/blocks/embed/style-rtl.css 419 B 0 B
build/block-library/blocks/embed/style.css 419 B 0 B
build/block-library/blocks/file/editor-rtl.css 246 B 0 B
build/block-library/blocks/file/editor.css 245 B 0 B
build/block-library/blocks/file/style-rtl.css 288 B 0 B
build/block-library/blocks/file/style.css 289 B 0 B
build/block-library/blocks/freeform/editor-rtl.css 2.49 kB 0 B
build/block-library/blocks/freeform/editor.css 2.49 kB 0 B
build/block-library/blocks/gallery/editor-rtl.css 692 B 0 B
build/block-library/blocks/gallery/editor.css 693 B 0 B
build/block-library/blocks/gallery/style-rtl.css 1.11 kB 0 B
build/block-library/blocks/gallery/style.css 1.11 kB 0 B
build/block-library/blocks/group/editor-rtl.css 364 B 0 B
build/block-library/blocks/group/editor.css 364 B 0 B
build/block-library/blocks/group/style-rtl.css 117 B 0 B
build/block-library/blocks/group/style.css 117 B 0 B
build/block-library/blocks/heading/editor-rtl.css 174 B 0 B
build/block-library/blocks/heading/editor.css 174 B 0 B
build/block-library/blocks/heading/style-rtl.css 137 B 0 B
build/block-library/blocks/heading/style.css 137 B 0 B
build/block-library/blocks/html/editor-rtl.css 322 B 0 B
build/block-library/blocks/html/editor.css 324 B 0 B
build/block-library/blocks/image/editor-rtl.css 738 B 0 B
build/block-library/blocks/image/editor.css 737 B 0 B
build/block-library/blocks/image/style-rtl.css 510 B 0 B
build/block-library/blocks/image/style.css 511 B 0 B
build/block-library/blocks/latest-comments/editor-rtl.css 201 B 0 B
build/block-library/blocks/latest-comments/editor.css 200 B 0 B
build/block-library/blocks/latest-comments/style-rtl.css 315 B 0 B
build/block-library/blocks/latest-comments/style.css 315 B 0 B
build/block-library/blocks/latest-posts/editor-rtl.css 183 B 0 B
build/block-library/blocks/latest-posts/editor.css 183 B 0 B
build/block-library/blocks/latest-posts/style-rtl.css 568 B 0 B
build/block-library/blocks/latest-posts/style.css 567 B 0 B
build/block-library/blocks/list/editor-rtl.css 129 B 0 B
build/block-library/blocks/list/editor.css 129 B 0 B
build/block-library/blocks/list/style-rtl.css 127 B 0 B
build/block-library/blocks/list/style.css 127 B 0 B
build/block-library/blocks/media-text/editor-rtl.css 240 B 0 B
build/block-library/blocks/media-text/editor.css 240 B 0 B
build/block-library/blocks/media-text/style-rtl.css 579 B 0 B
build/block-library/blocks/media-text/style.css 577 B 0 B
build/block-library/blocks/more/editor-rtl.css 479 B 0 B
build/block-library/blocks/more/editor.css 479 B 0 B
build/block-library/blocks/navigation-link/editor-rtl.css 438 B 0 B
build/block-library/blocks/navigation-link/editor.css 440 B 0 B
build/block-library/blocks/navigation-link/style-rtl.css 747 B 0 B
build/block-library/blocks/navigation-link/style.css 745 B 0 B
build/block-library/blocks/navigation/editor-rtl.css 1.31 kB 0 B
build/block-library/blocks/navigation/editor.css 1.31 kB 0 B
build/block-library/blocks/navigation/style-rtl.css 205 B 0 B
build/block-library/blocks/navigation/style.css 205 B 0 B
build/block-library/blocks/nextpage/editor-rtl.css 440 B 0 B
build/block-library/blocks/nextpage/editor.css 440 B 0 B
build/block-library/blocks/paragraph/editor-rtl.css 161 B 0 B
build/block-library/blocks/paragraph/editor.css 161 B 0 B
build/block-library/blocks/paragraph/style-rtl.css 279 B 0 B
build/block-library/blocks/paragraph/style.css 279 B 0 B
build/block-library/blocks/post-author/editor-rtl.css 255 B 0 B
build/block-library/blocks/post-author/editor.css 255 B 0 B
build/block-library/blocks/post-author/style-rtl.css 229 B 0 B
build/block-library/blocks/post-author/style.css 230 B 0 B
build/block-library/blocks/post-comments-form/style-rtl.css 293 B 0 B
build/block-library/blocks/post-comments-form/style.css 293 B 0 B
build/block-library/blocks/post-content/editor-rtl.css 187 B 0 B
build/block-library/blocks/post-content/editor.css 187 B 0 B
build/block-library/blocks/post-excerpt/editor-rtl.css 134 B 0 B
build/block-library/blocks/post-excerpt/editor.css 134 B 0 B
build/block-library/blocks/post-featured-image/editor-rtl.css 387 B 0 B
build/block-library/blocks/post-featured-image/editor.css 386 B 0 B
build/block-library/blocks/post-featured-image/style-rtl.css 149 B 0 B
build/block-library/blocks/post-featured-image/style.css 149 B 0 B
build/block-library/blocks/preformatted/style-rtl.css 119 B 0 B
build/block-library/blocks/preformatted/style.css 119 B 0 B
build/block-library/blocks/pullquote/editor-rtl.css 231 B 0 B
build/block-library/blocks/pullquote/editor.css 231 B 0 B
build/block-library/blocks/pullquote/style-rtl.css 359 B 0 B
build/block-library/blocks/pullquote/style.css 359 B 0 B
build/block-library/blocks/query-loop/editor-rtl.css 142 B 0 B
build/block-library/blocks/query-loop/editor.css 141 B 0 B
build/block-library/blocks/query-loop/style-rtl.css 361 B 0 B
build/block-library/blocks/query-loop/style.css 363 B 0 B
build/block-library/blocks/query/editor-rtl.css 210 B 0 B
build/block-library/blocks/query/editor.css 210 B 0 B
build/block-library/blocks/quote/editor-rtl.css 121 B 0 B
build/block-library/blocks/quote/editor.css 121 B 0 B
build/block-library/blocks/quote/style-rtl.css 215 B 0 B
build/block-library/blocks/quote/style.css 214 B 0 B
build/block-library/blocks/rss/editor-rtl.css 245 B 0 B
build/block-library/blocks/rss/editor.css 246 B 0 B
build/block-library/blocks/rss/style-rtl.css 329 B 0 B
build/block-library/blocks/rss/style.css 328 B 0 B
build/block-library/blocks/search/editor-rtl.css 213 B 0 B
build/block-library/blocks/search/editor.css 213 B 0 B
build/block-library/blocks/search/style-rtl.css 384 B 0 B
build/block-library/blocks/search/style.css 386 B 0 B
build/block-library/blocks/separator/editor-rtl.css 151 B 0 B
build/block-library/blocks/separator/editor.css 151 B 0 B
build/block-library/blocks/separator/style-rtl.css 281 B 0 B
build/block-library/blocks/separator/style.css 281 B 0 B
build/block-library/blocks/shortcode/editor-rtl.css 547 B 0 B
build/block-library/blocks/shortcode/editor.css 547 B 0 B
build/block-library/blocks/site-logo/editor-rtl.css 251 B 0 B
build/block-library/blocks/site-logo/editor.css 251 B 0 B
build/block-library/blocks/site-logo/style-rtl.css 166 B 0 B
build/block-library/blocks/site-logo/style.css 166 B 0 B
build/block-library/blocks/social-link/editor-rtl.css 211 B 0 B
build/block-library/blocks/social-link/editor.css 211 B 0 B
build/block-library/blocks/social-links/editor-rtl.css 749 B 0 B
build/block-library/blocks/social-links/editor.css 749 B 0 B
build/block-library/blocks/social-links/style-rtl.css 1.37 kB 0 B
build/block-library/blocks/social-links/style.css 1.37 kB 0 B
build/block-library/blocks/spacer/editor-rtl.css 321 B 0 B
build/block-library/blocks/spacer/editor.css 321 B 0 B
build/block-library/blocks/spacer/style-rtl.css 107 B 0 B
build/block-library/blocks/spacer/style.css 107 B 0 B
build/block-library/blocks/subhead/editor-rtl.css 148 B 0 B
build/block-library/blocks/subhead/editor.css 148 B 0 B
build/block-library/blocks/subhead/style-rtl.css 134 B 0 B
build/block-library/blocks/subhead/style.css 134 B 0 B
build/block-library/blocks/table/editor-rtl.css 530 B 0 B
build/block-library/blocks/table/editor.css 530 B 0 B
build/block-library/blocks/table/style-rtl.css 433 B 0 B
build/block-library/blocks/table/style.css 433 B 0 B
build/block-library/blocks/tag-cloud/editor-rtl.css 162 B 0 B
build/block-library/blocks/tag-cloud/editor.css 162 B 0 B
build/block-library/blocks/tag-cloud/style-rtl.css 145 B 0 B
build/block-library/blocks/tag-cloud/style.css 145 B 0 B
build/block-library/blocks/template-part/editor-rtl.css 644 B 0 B
build/block-library/blocks/template-part/editor.css 645 B 0 B
build/block-library/blocks/text-columns/editor-rtl.css 146 B 0 B
build/block-library/blocks/text-columns/editor.css 146 B 0 B
build/block-library/blocks/text-columns/style-rtl.css 209 B 0 B
build/block-library/blocks/text-columns/style.css 209 B 0 B
build/block-library/blocks/verse/editor-rtl.css 118 B 0 B
build/block-library/blocks/verse/editor.css 118 B 0 B
build/block-library/blocks/verse/style-rtl.css 137 B 0 B
build/block-library/blocks/verse/style.css 137 B 0 B
build/block-library/blocks/video/editor-rtl.css 547 B 0 B
build/block-library/blocks/video/editor.css 548 B 0 B
build/block-library/blocks/video/style-rtl.css 241 B 0 B
build/block-library/blocks/video/style.css 241 B 0 B
build/block-library/common-rtl.css 940 B 0 B
build/block-library/common.css 937 B 0 B
build/block-library/editor-rtl.css 8.87 kB 0 B
build/block-library/editor.css 8.87 kB 0 B
build/block-library/style-rtl.css 8.48 kB 0 B
build/block-library/style.css 8.48 kB 0 B
build/block-library/theme-rtl.css 789 B 0 B
build/block-library/theme.css 790 B 0 B
build/components/style-rtl.css 15.4 kB 0 B
build/components/style.css 15.4 kB 0 B
build/edit-navigation/style-rtl.css 881 B 0 B
build/edit-navigation/style.css 885 B 0 B
build/edit-post/style-rtl.css 6.47 kB 0 B
build/edit-post/style.css 6.45 kB 0 B
build/edit-site/style-rtl.css 3.91 kB 0 B
build/edit-site/style.css 3.91 kB 0 B
build/edit-widgets/style-rtl.css 3.1 kB 0 B
build/edit-widgets/style.css 3.1 kB 0 B
build/editor/editor-styles-rtl.css 476 B 0 B
build/editor/editor-styles.css 478 B 0 B
build/editor/style-rtl.css 3.84 kB 0 B
build/editor/style.css 3.84 kB 0 B
build/format-library/style-rtl.css 547 B 0 B
build/format-library/style.css 548 B 0 B
build/list-reusable-blocks/style-rtl.css 476 B 0 B
build/list-reusable-blocks/style.css 476 B 0 B
build/nux/style-rtl.css 671 B 0 B
build/nux/style.css 668 B 0 B

compressed-size-action

@ockham ockham removed the [Status] In Progress Tracking issues with work in progress label Dec 11, 2020
@ockham ockham marked this pull request as ready for review December 11, 2020 21:22
Copy link
Copy Markdown
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach, moving bits by bits to a CI script starting from the end :)

Do you know if we can test the new validation API Github released in this action?

unzip gutenberg.zip -d trunk
rm gutenberg.zip

- name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand why this step is needed? Do we do that in the release script as well? I mean we're supposed to update the stable tag after the svn tag is created, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand why this step is needed? Do we do that in the release script as well? I mean we're supposed to update the stable tag after the svn tag is created, right?

Yeah, I carried this one over from the release script, and it didn't seem to make too much sense to me either 😬
Happy to remove it 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well if it's in the release script, maybe @jorgefilipecosta know why it's needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The readme.txt of the plugin is maintained on the Github repository. But it does not refer a stable tag, it contains "Stable tag: V.V.V" as the stable tag.
When we commit something to trunk we first need to put the previous stable tag on the placeholder. Then when tagging the release we update the stable tag again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I understand now. I'll rephrase, to highlight what I think is crucial here:

  1. We update trunk to match the build we've just produced.
  2. We tag that snapshot of trunk with the current version.
  3. We set the stable version in readme.txt to point to that tag.

Steps 1. and 3. update trunk/. However, we cannot update the stable version to the new one in step 1, as the tag doesn't exist yet. Obviously, we also cannot leave it at V.V.V, so instead, we set it to the previous version.

Copy link
Copy Markdown
Contributor Author

@ockham ockham Dec 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a bit of a weird side effect however: A tag's readme.txt has the previous version set as its Stable version. See e.g. 9.5.2's readme.txt: https://plugins.trac.wordpress.org/browser/gutenberg/tags/9.5.2/readme.txt#L6 ("Stable tag: 9.5.1")

Or 9.3.0's: https://plugins.trac.wordpress.org/browser/gutenberg/tags/9.3.0/readme.txt#L6 ("Stable tag: 9.2.2")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a follow-up, I think this could be addressed by:

  1. Creating the new tag first.
    • I still have to brush up my svn-fu, but I think this could be done by copying the previous tag to the new one (all remotely?), then checking out the new one locally, and overriding it with the new Gutenberg plugin contents (including the new version). (This assumes that unlike git, svn tags are more like branches, and can be "pushed" to after creating.)
  2. Copying/merging/... that new tag to trunk/.

Comment thread .github/workflows/upload-release-to-plugin-repo.yml
@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Dec 14, 2020

I like this approach, moving bits by bits to a CI script starting from the end :)

Happy to hear! 🎉

Do you know if we can test the new validation API Github released in this action?

You mean this thing you mentioned the other day? I'd be happy to give that a try, but haven't really found any public-facing documentation on that yet. Do you have any pointers?

Copy link
Copy Markdown
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go ahead and remove this part from the release command?

@youknowriad
Copy link
Copy Markdown
Contributor

The manual approval thing doesn't seem to be released yet. We'll have to circle back later for that.

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Dec 15, 2020

Should we go ahead and remove this part from the release command?

Will do! 👍

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Dec 15, 2020

Should we go ahead and remove this part from the release command?

Will do!

Done per the last two commits.

To get this ready for prime time, we need to:

  1. Remove the dummy echo lines, and uncomment the actual svn operations.
  2. Add svn secrets to the repo.

@youknowriad Want me to proceed with # 1.? (Once I do this, it'll be harder to give this a 'dry-run' test.)

Item # 2. apparently requires either the owner of the gutenberg repo, or someone with admin access to the WordPress org.

@youknowriad
Copy link
Copy Markdown
Contributor

I can do 2, I'm wondering who's credentials we should put there or if we should created a dedicated wp.org account for that. Thoughts cc @mcsf

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Dec 15, 2020

I can do 2, I'm wondering who's credentials we should put there or if we should created a dedicated wp.org account for that.

Dedicated seems to make sense to me 🤔

@mcsf
Copy link
Copy Markdown
Contributor

mcsf commented Dec 21, 2020

if we should created a dedicated wp.org account for that

This makes more sense to me, but have we consulted #meta? Maybe @ocean90?

@ockham ockham force-pushed the add/svn-upload-gh-action branch from cfa120d to 0564cc0 Compare January 4, 2021 11:55
@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Jan 4, 2021

I've now removed the echos and uncommented the 'actual' commands. I've also created a gutenbergplugin user on WP.org, which I'm going to use for the upload to SVN.

Copy link
Copy Markdown
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOLO, I'm doing the next stable release on Wednesday, I guess if something wrong happens, it's on me :P

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Jan 4, 2021

Thanks @youknowriad!

I just noticed I apparently need to reference the environment in the job: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment

Will push a commit!

@youknowriad
Copy link
Copy Markdown
Contributor

The environment name I've used is wp.org plugin

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Jan 4, 2021

Thanks! Set the environment per 0259ab6.

@youknowriad
Copy link
Copy Markdown
Contributor

What could go wrong 🤷‍♂️ :)

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Jan 4, 2021

I'll give this a quick test using my fork and an svn test repo (set up via https://riouxsvn.com/, as suggested by @jorgefilipecosta in Slack).

@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Jan 4, 2021

I'll give this a quick test using my fork and an svn test repo (set up via https://riouxsvn.com/, as suggested by @jorgefilipecosta in Slack).

This has worked well in my testing: https://github.com/ockham/gutenberg/runs/1645617284?check_suite_focus=true.

I even recreated the wp.org plugin environment in my fork. Here's a screencast of what it looks like to review the deploy:

plugin-upload-2

The plugin was successfully uploaded to my test repo (both trunk and new tag), and the version in readme.txt was bumped 🎉

@ockham ockham merged commit 5e7ffa9 into master Jan 4, 2021
@ockham ockham deleted the add/svn-upload-gh-action branch January 4, 2021 19:43
@github-actions github-actions Bot added this to the Gutenberg 9.8 milestone Jan 4, 2021
youknowriad pushed a commit that referenced this pull request Jan 6, 2021
The idea here is to couple the upload of the Gutenberg plugin to the WP.org plugin repo tightly to when a new release is published to GitHub, rather than running it from the local system of whoever's in charge of releasing that version.

Moving parts of the release workflow from locally running scripts to GH actions should overall make the process more easily reproducible, and should free up time and resources required for the release process.

The relevant job needs to be [approved](https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/reviewing-deployments#approving-or-rejecting-a-job) by a qualified reviewer (i.e. a member of the `gutenberg-core` team). This is to ensure that plugin releases cannot be published by anyone who has commit access to the GitHub repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants