Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changesets Action Release Functionality #672

Closed
wants to merge 113 commits into from
Closed

Changesets Action Release Functionality #672

wants to merge 113 commits into from

Conversation

samchungy
Copy link
Contributor

@samchungy samchungy commented Nov 16, 2021

Ported changeset release functionality to Skuba.

Adapted code from https://github.com/changesets/action for use in this repository.

Testing

Tested using a beta package on hirer-budgets.

  • Confirmed PR is created on version step.
  • Confirmed package is visible in GitHub Releases.
  • Confirmed package is available on npm.

image

image

image

commit 91b8810
Merge: f663bb1 9408d5c
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 17:13:07 2021 +1100

    resolve merge

commit f663bb1
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 17:00:46 2021 +1100

    feat: add coreAdapter

commit b6c0c06
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 16:23:32 2021 +1100

    feat: create adapter

commit 4b08176
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 16:06:07 2021 +1100

    feat: initial adaption

commit 0959a49
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 15:15:52 2021 +1100

    fix: correct test title

commit c49ad90
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 15:14:06 2021 +1100

    refactor: remove changeset

commit d315540
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 15:13:53 2021 +1100

    feat: mock isomorphic-git

commit 38aabd7
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 15:06:30 2021 +1100

    Create pink-gifts-count.md

commit d024d61
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:57:24 2021 +1100

    refactor: move to utils folder

commit 6cea5ae
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:53:21 2021 +1100

    refactor: use inline export

commit e69a285
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:51:23 2021 +1100

    fix: use await

commit 118a50b
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:43:08 2021 +1100

    fix: correct mock declarations

commit 206bc2e
Merge: 623c605 f0d814e
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:38:34 2021 +1100

    Merge branch 'master' of github.com:seek-oss/skuba into refactor-github-utils

commit 623c605
Author: Sam Chung <[email protected]>
Date:   Tue Nov 16 14:36:57 2021 +1100

    refactor: move common operations out of checkRun
@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2021

🦋 Changeset detected

Latest commit: 76de7a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

src/utils/git.ts Outdated Show resolved Hide resolved
src/cli/changeset/gitUtils.ts Outdated Show resolved Hide resolved
src/cli/changeset/run.ts Outdated Show resolved Hide resolved
src/cli/changeset/gitUtils.ts Outdated Show resolved Hide resolved
src/cli/changeset/init.ts Outdated Show resolved Hide resolved
src/cli/changeset/init.ts Outdated Show resolved Hide resolved
src/cli/changeset/utils.ts Outdated Show resolved Hide resolved
@72636c 72636c changed the base branch from raw-changeset to master November 18, 2021 02:40
@samchungy samchungy changed the title Changeset Action Functionality Changesets Action Release Functionality Mar 27, 2022

This topic details the changesets version and release functionality baked into **skuba**. This functionality is based off the [changesets action].

Running `skuba changesets` will run one of two steps: [version](#version) or [publish](#publish).
Copy link
Member

@72636c 72636c Mar 30, 2022

Choose a reason for hiding this comment

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

I'm guessing that the consumer would still run yarn changeset locally to generate a changeset. Is it potentially confusing to have a similarly named yarn skuba changesets command?

One alternative would be to align it closer with the existing release command, by either

  1. Naming it release-changesets, similar to the build-package command (which I don't love but works for now).
  2. Overloading release and driving the choice of tool (Changesets or semantic-release) through configuration under package.json. This is likely how we'll end up supporting different build tools, and also opens up the door to us changing the default tool in a future major version without requiring any changes to existing package.json scripts.

Comment on lines +20 to +26
## Version

This will analyse your repository for changesets and will create or update a pull request with the title 'Version Packages' with updated package versions and changelogs.

## Publish

When the pull request created from the version step is merged the publish step will run and publish packages to npm.
Copy link
Member

Choose a reason for hiding this comment

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

Can we document how the command decides which step to run? Happy to help wordsmith this section.

src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/index.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/utils.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.int.test.ts Outdated Show resolved Hide resolved
src/cli/changesets/gitUtils.ts Outdated Show resolved Hide resolved
Comment on lines 8 to 9
- [19fe6c1b](https://github.com/keystonejs/keystone-5/commit/19fe6c1b):
Move frontmatter in docs into comments
Copy link
Member

Choose a reason for hiding this comment

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

Can we bundle a custom changelog generator like skuba uses itself? https://github.com/seek-oss/skuba/blob/master/.changeset/changelog.js

This one supports GitHub-based versioning (i.e. PR numbers) when a GITHUB_TOKEN is available, falling back to Git-based versioning (i.e. commit hashes).

package.json Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
src/cli/changesets/run.ts Outdated Show resolved Hide resolved
@samchungy samchungy marked this pull request as draft April 6, 2022 10:28
@72636c 72636c added the dino:snooze Snooze in Review Dino label Apr 12, 2022
@samchungy
Copy link
Contributor Author

FES are going to make their own version of this so I'm going to close til I see theirs so we don't double our efforts

@samchungy samchungy closed this Jun 5, 2022
@72636c 72636c deleted the changeset branch June 5, 2022 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dino:snooze Snooze in Review Dino
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants