Skip to content

Commit

Permalink
Add build and ci support for cdn (#143)
Browse files Browse the repository at this point in the history
* add build and ci support for cdn

* isolate rollup cdn build + drop terser + drop jq
  • Loading branch information
sodiray authored Nov 8, 2022
1 parent 162fa7f commit a2a635c
Show file tree
Hide file tree
Showing 8 changed files with 1,662 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## Description

Please provide a detailed description of the changes and the intent behind them :)

## Checklist

- [ ] Changes are covered by tests if behavior has been changed or added
- [ ] Tests have 100% coverage
- [ ] The version in `package.json` has been bumped according to the changes made and standard semantic versioning rules
- [ ] If code changes were made, the version in `package.json` has been bumped (matching semver)
- [ ] If code changes were made, the `yarn build` command has been run and to update the `cdn` directory

## Resolves

If the PR resolves an open issue tag it here. For example, `Resolves #34`
26 changes: 26 additions & 0 deletions .github/workflows/semver-on-release-labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,29 @@ jobs:
} else {
core.setFailed(`The pr version (${pr}) is not greater than the base version (${base}). A pull request labeled with 'release' must have a valid version bump.`)
}
verify-cdn-version:
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Pull Request Version
id: pr-version
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Get CDN Build Version
id: cdn-version
run: echo "version=$(cat cdn/.version)" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/github-script@v6
env:
PR_VERSION: ${{steps.pr-version.outputs.version}}
CDN_VERSION: ${{steps.cdn-version.outputs.version}}
with:
script: |
const { PR_VERSION: pr, CDN_VERSION: cdn } = process.env
if (pr.trim() !== cdn.trim()) {
core.setFailed(`The cdn .version (${cdn}) does not match the PR branch version (${pr}). Maybe you didn't run yarn build before pushing?`)
} else {
core.debug(`Success, the cdn build version matches the pr version.`)
}
1 change: 1 addition & 0 deletions cdn/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9.0.2
Loading

0 comments on commit a2a635c

Please sign in to comment.