Skip to content

Conversation

@ROpdebee
Copy link
Owner

@ROpdebee ROpdebee commented Oct 17, 2021

I originally intended to only enable CD after E2E tests were added, but since there's now 2 PRs open which could both be released as a new version and I didn't want to run into conflicts by bumping the version in both PRs separately, I'm adding it now.

Quick summary of the changes:

  • Workflows on PRs will remain the same.
  • Workflows on pushes to main (i.e. after PR merges) are removed and replaced by workflows that run after a PR is merged. The reason is that this allows us to more easily figure out the PR associated with the change. We'll need this to report deployment status on the PR, and also to report the PR in the deployment commit message.
  • Versions are now automatically generated by bumping from the version extracted from the previous deployed version. So meta.ts files don't contain versions anymore.
  • Deployments are skipped if 1) building or testing fails; 2) there is no change between the old deployed version and the built version after the PR is merged (differences in the versions are taken into account here); or 3) a "skip cd" label is set on the PR.
  • There's now a scheduled nightly workflow which builds and tests userscripts, to replace the workflow that usually ran on pushes to main. That scheduled workflow will also create an issue if it fails (at most one issue will be open at any given time, if a run fails and an issue already exists and is open, the existing issue will be edited).
  • npm run build and npm run build-dev now generate a version themselves, but this should only really be used for local development usage or in CI to check that the scripts can be built correctly.

Since we're adding functionality to build a single script in isolation,
we changed the `del` plugin to only remove the built files for the script
which is currently being built. This is unnecessary, since they'll be
overwritten anyway.
Changing the previous CD setup to remove the requirement to manually
bump the version whenever a release needs to be made. `commit_release`
will now compare the previously built version to a built version of the
most recent code. When any change is detected to the built code, it will
automatically increment the version and commit the new version to `dist`,
as before.
We were previously deploying on any push to `main`. Since we won't
directly push to `main`, we can instead run the deployments after
PRs are merged. This will allow us to leave a comment on the PR
after the deployment is done, or if it has somehow failed.
@ROpdebee ROpdebee force-pushed the continuous-deployment branch from 7566adb to afcfcd5 Compare October 17, 2021 18:59
@ROpdebee ROpdebee force-pushed the continuous-deployment branch from 832bc68 to 5ebc3e4 Compare October 17, 2021 21:26
@codecov
Copy link

codecov bot commented Oct 17, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@b90c6a5). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             main       #84   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?        27           
  Lines           ?       481           
  Branches        ?        84           
========================================
  Hits            ?       481           
  Misses          ?         0           
  Partials        ?         0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b90c6a5...7140b31. Read the comment docs.

We'll be using those files to create dynamic install badges.
@ROpdebee
Copy link
Owner Author

Merging this without review because it's blocking some other PRs and the easiest way to make sure it's working properly is to actually push it :) Apologies! Feel free to leave any remarks and I'll do the fixes afterwards.

@ROpdebee ROpdebee merged commit 5dc2f12 into main Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants