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

feat(ci): continuous releases for main and PRs with pkg.pr.new #10369

Merged
merged 7 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Continuous Releases

on:
push:
branches:
- main
- docusaurus-v**
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
release:
name: Continuous Releases
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Installation
run: yarn

- name: Build packages
run: yarn build:packages

- name: Fresh templates
run: |
yarn create-docusaurus fresh-examples/docusaurus-classic classic --javascript -p npm -s
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not need installs, since templates would just be uploaded!

I also use npm here so we avoid that error, at least until I fix the issue with yarn in pkg.pr.new!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm, wondering if generating a package-lock.json wouldn't be useful?

It looks like a tradeoff: resolve package versions ahead of time in CI vs letting the stackblitz user handle it. Maybe the DX will be better/faster for the end user if versions are already pre-resolved?

yarn create-docusaurus fresh-examples/docusaurus-classic-typescript classic --typescript -p npm -s

- name: Release
run: npx pkg-pr-new publish './packages/*' --template './fresh-examples/*' --compact --comment=off
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also turned off comments since there are many packages, but still, on each commit, we'll have the Continuous Releases check run.

image

When clicking details, we can see all the packages there without the need for a comment on each pull request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks

I think the comment is helpful for discovery, but it has to be more concise to be effective and only post the 2 template links. Until you have a better comment, it's preferable to hide it.

1 change: 1 addition & 0 deletions examples/classic/docusaurus.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.