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

Remove release branch workflow #7827

Merged
merged 24 commits into from Oct 13, 2020

Conversation

@etimberg
Copy link
Member

@etimberg etimberg commented Oct 1, 2020

Motivation

I keep messing up the release process. The merge to the release branch needs to be done exactly correctly, or else subsequent releases require lots of git correction. This aims to present a simplified release process that integrates better with GitHub. Additionally, we've observed a lot of instability in Travis over the past summer. Moving to GitHub actions for the CI will hopefully provide some needed stability and remove the need to re-run the CI.

To Do

  • Remove Travis
  • Add action steps to upload files to the release
  • Automatically set --tag next for publish when the release is a pre-release
  • Automatically set the package.json version from the release name
  • GitHub actions needs to deploy the docs

Testing

I'm not sure off hand what the best way to test this is. Perhaps switch the command to npm publish --dry-run and try it out with a tag we don't intend to release?

I have run the following manual tests already

  • ./scripts/docs-config.sh "master" successfully sets the version to "master"
  • ./scripts/docs-config.sh "3.0.0" successfully sets the version to "latest"
  • ./scripts/docs-config.sh "3.0.0-beta.3" successfully sets the version to "next"
  • ./scripts/deploy-docs.sh "master" successfully commits to "master"
  • ./scripts/deploy-docs.sh "3.0.0" successfully commits to "latest"
  • ./scripts/deploy-docs.sh "3.0.0-beta.3" successfully commits to "next"
  • ./scripts/publish.sh" sets tag correctly based on $GITHUB_REF`
  • Manually run deploy docs steps in a new folder and confirm it works
  • Manually run publish steps in a new folder and confirm that it works
.github/workflows/npmpublish.yml Outdated Show resolved Hide resolved
@etimberg etimberg changed the title Remove release branch workflow Draft: Remove release branch workflow Oct 1, 2020
@etimberg etimberg force-pushed the etimberg:remove-release-branch-workflow branch from 8ca82bf to 2254d09 Oct 3, 2020
scripts/deploy-docs.sh Outdated Show resolved Hide resolved
scripts/publish.sh Outdated Show resolved Hide resolved
@etimberg
Copy link
Member Author

@etimberg etimberg commented Oct 3, 2020

@kurkle I made some good progress on this. I still need to do the upload release artifacts stuff (though I am unsure how many people use this) but there seem to be a few options for it, though I am unsure how to get the release URL from GitHub so that needs investigation.

@kurkle
Copy link
Collaborator

@kurkle kurkle commented Oct 7, 2020

@kurkle I made some good progress on this. I still need to do the upload release artifacts stuff (though I am unsure how many people use this) but there seem to be a few options for it, though I am unsure how to get the release URL from GitHub so that needs investigation.

I think you could use that: https://github.com/actions/upload-release-asset

etimberg added 2 commits Oct 10, 2020
@etimberg etimberg changed the title Draft: Remove release branch workflow Remove release branch workflow Oct 10, 2020
etimberg added 2 commits Oct 10, 2020
.github/workflows/npmpublish.yml Outdated Show resolved Hide resolved
.github/workflows/npmpublish.yml Outdated Show resolved Hide resolved
@etimberg
Copy link
Member Author

@etimberg etimberg commented Oct 10, 2020

I added in a few more changes. I tested docs-config.sh locally. I will test the others out tomorrow and confirm that it all works as expected.

@etimberg
Copy link
Member Author

@etimberg etimberg commented Oct 11, 2020

@kurkle I think this is good to review. I tested the steps locally and I think the docs stuff is all correct (assuming I got the GitHub actions setup correctly)

npm ci
npm install -g json
json -I -f package.json -e "this.version=\"$GITHUB_REF\""
json -I -f package-lock.json -e "this.version=\"$GITHUB_REF\""

This comment has been minimized.

@kurkle

kurkle Oct 12, 2020
Collaborator

Should the version change be committed?

I'm a bit torn about the release workflow. This way lets us do a release of any version regardless of the version in the target branch. A tag will be created with the release version number, but if we don't commit the version change, I think the actual package.json in that tag will have the version that was in the released branch at publish time.

This comment has been minimized.

@etimberg

etimberg Oct 12, 2020
Author Member

I'm torn as well. Having the version in the code is quite nice, but I'm not sure that we'd want to commit again since the tag would be created when the release is created in the UI. Maybe the flow should be very different and we start with a different action.

This comment has been minimized.

@kurkle

kurkle Oct 13, 2020
Collaborator

On approach could be a manually triggered workflow:

  • Version as input
  • tests
  • update package.json and commit
  • build and pack
  • update draft release with asset
  • push docs
  • publish to npm
  • publish the release

anyway, most of the needed steps are here already, I'm ok with committing this and testing it out.

This comment has been minimized.

@etimberg

etimberg Oct 13, 2020
Author Member

Ok, perfect. I will commit soon and we can figure out how to test. We have some new features, so we can try to get a beta.4 out the door

.github/workflows/npmpublish.yml Outdated Show resolved Hide resolved
.github/workflows/npmpublish.yml Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
scripts/deploy-docs.sh Outdated Show resolved Hide resolved
scripts/deploy.sh Show resolved Hide resolved
.github/workflows/deploy-docs.yml Show resolved Hide resolved
@kurkle
kurkle approved these changes Oct 13, 2020
@etimberg etimberg merged commit ff354cc into chartjs:master Oct 13, 2020
3 checks passed
3 checks passed
build (ubuntu-latest) build (ubuntu-latest)
Details
build (windows-latest) build (windows-latest)
Details
codeclimate All good!
Details
@etimberg etimberg deleted the etimberg:remove-release-branch-workflow branch Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.