-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add packages release workflow (#3)
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ORIGINALLY FROM CLOUDFLARE WRANGLER: | ||
// https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js | ||
|
||
const { exec } = require("child_process"); | ||
|
||
// This script is used by the `release.yml` workflow to update the version of the packages being released. | ||
// The standard step is only to run `changeset version` but this does not update the package-lock.json file. | ||
// So we also run `npm install`, which does this update. | ||
// This is a workaround until this is handled automatically by `changeset version`. | ||
// See https://github.com/changesets/changesets/issues/421. | ||
exec("npx changeset version") | ||
exec("npm install") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Release next-youtube-livechat | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- packages\next-youtube-livechat | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
release: | ||
name: Create a PR for release workflow | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
deployments: write | ||
packages: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Restore project deps | ||
run: npm ci | ||
|
||
- name: Build the package next-youtube-livechat | ||
run: cd packages/next-youtube-livechat && npm run build | ||
|
||
- name: Lint check | ||
run: npm run lint | ||
|
||
- name: Code format check | ||
run: npm run format | ||
|
||
- name: Typescript check | ||
run: npm run typecheck | ||
|
||
- name: Create Version PR or Publish to NPM | ||
id: changesets | ||
uses: changesets/action@v1.4.7 | ||
with: | ||
commit: "chore(release): version packages" | ||
title: "chore(release): version packages" | ||
version: node .github/changeset-version.js | ||
publish: npx changeset publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
NODE_ENV: "production" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.prettierignore | ||
**/.next/** | ||
**/_next/** | ||
**/dist/** |