-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
chore: add a release and deploy Github Action #7385
Conversation
The release job will do an npm publish and a github-release. It's based on videojs/.github/github-release.yml. The new version is published as `next` and requires to be promoted to latest manually. The deploy job, should do an aws s3 sync to upload the files to S3 for us. It uses a Github Environment secrets. This is so that we can require a user to approve the CDN upload.
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: get current changelog | ||
run: node -e "console.log(require('./build/current-changelog.js')())" > CHANGELOG-LATEST.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to continue using what we have locally for now until we deprecate releasing locally with the gh-release or update it to use the same thing that's in videojs/.github/github-release.yml
# publish runs build for us via a prepublishOnly script | ||
- name: npm release | ||
run: npm publish --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add this to VHS too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I could see benefits to us publishing in ci, perhaps we even make the build depend upon the ci integration passing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, though, I think making it happen on a tag is fine. It means user-intervention is required for publishing.
Codecov Report
@@ Coverage Diff @@
## main #7385 +/- ##
=======================================
Coverage 79.72% 79.72%
=======================================
Files 116 116
Lines 7295 7295
Branches 1753 1753
=======================================
Hits 5816 5816
Misses 1479 1479 Continue to review full report at Codecov.
|
|
||
# publish runs build for us via a prepublishOnly script | ||
- name: npm release | ||
run: npm publish --tag next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always want to publish to the next tag by default and then later on someone can manually upgrade the version.
|
||
- name: Copy files to the CDN with the AWS CLI | ||
run: | | ||
aws s3 sync node_modules/video.js/dist/ s3://${S3_KEY}/${VJS_VERSION}/ --acl ${S3_ACCESS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should upload to a full version specific folder, i.e. 7.15.0/video.js
. I may create a promote
workflow that can set the npm tag to latest and also upload it to s3 under the minor, i.e. 7.15/video.js
(and maybe major too, i.e. 7/video.js
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this should work, I wasn't able to test it directly, so, our first release with this will likely be also our test. I was able to test the gh and npm release in a test project and those worked flawlessly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new task would be cool, because we could potentially automate updating the GH Release to no longer be a pre-release either.
runs-on: ubuntu-latest | ||
environment: Deploy | ||
env: | ||
VJS_VERSION: ${{ github.event.head_commit.message }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have it set up so that the commit message here is the full version of Video.js without any preceding v
, so, we can use it directly as the VJS_VERSION.
deploy: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
environment: Deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This env is what makes the AWS secrets available. It also requires a manual approval from me before it'll run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want deploy
to run on semver prereleases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't previously, but I don't see an issue with doing so. We also haven't done semver pre-releases in Video.js in a long time.
token: ${{github.token}} | ||
prerelease: true | ||
files: dist/*.zip | ||
discussion_category_name: Releases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a discussion from the release under the Releases category.
Co-authored-by: Brandon Casey <[email protected]>
The release job will do an npm publish and a github-release. It's based on videojs/.github/github-release.yml. The new version is published as `next` and requires to be promoted to latest manually. The deploy job, should do an aws s3 sync to upload the files to S3 for us. It uses a Github Environment secrets. This is so that we can require a user to approve the CDN upload.
The release job will do an npm publish and a github-release.
It's based on videojs/.github/github-release.yml.
The new version is published as
next
and requires to be promoted tolatest manually.
The deploy job, should do an aws s3 sync to upload the files to S3 for
us. It uses a Github Environment secrets. This is so that we can require
a user to approve the CDN upload.