Repository navigation
chore: prepare release metadata and workflow #1
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
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c5d723c
chore: enable vitest and migrate plugin setup
htnabe 7bb19b9
chore: migrate project tooling to Bun and TypeScript
htnabe f17ebbd
chore: add CI and repo automation templates
htnabe 7478e5e
chore: lefthook is added
htnabe 4797fdb
chore: prepare release metadata and workflow
htnabe d15cd0c
chore: switch publish workflow to manual release
htnabe 1bcc4ee
chore: updated lock file
htnabe 56bc56a
docs: align documentation with package and release setup
htnabe 1f474a5
fix: preserve empty front matter and restore performance assertions
htnabe e2fed07
chore: align repo automation and hook config
htnabe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| --- | ||
| name: Bug report | ||
| about: Create a report to help us improve | ||
| title: '' | ||
| labels: '' | ||
| assignees: '' | ||
| --- | ||
|
|
||
| **Describe the bug** | ||
| A clear and concise description of what the bug is. | ||
|
|
||
| **To Reproduce** | ||
| Steps to reproduce the behavior: | ||
|
|
||
| 1. Go to '...' | ||
| 2. Click on '....' | ||
| 3. Scroll down to '....' | ||
| 4. See error | ||
|
|
||
| **Expected behavior** | ||
| A clear and concise description of what you expected to happen. | ||
|
|
||
| **Screenshots** | ||
| If applicable, add screenshots to help explain your problem. | ||
|
|
||
| **Desktop (please complete the following information):** | ||
|
|
||
| - OS: [e.g. iOS] | ||
| - Browser [e.g. chrome, safari] | ||
| - Version [e.g. 22] | ||
|
|
||
| **Smartphone (please complete the following information):** | ||
|
|
||
| - Device: [e.g. iPhone6] | ||
| - OS: [e.g. iOS8.1] | ||
| - Browser [e.g. stock browser, safari] | ||
| - Version [e.g. 22] | ||
|
|
||
| **Additional context** | ||
| Add any other context about the problem here. |
This file contains hidden or 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,40 @@ | ||
| --- | ||
| name: Bug report | ||
| about: Create a report to help us improve | ||
| title: '' | ||
| labels: '' | ||
| assignees: '' | ||
| --- | ||
|
|
||
| **Describe the bug** | ||
| A clear and concise description of what the bug is. | ||
|
|
||
| **To Reproduce** | ||
| Steps to reproduce the behavior: | ||
|
|
||
| 1. Go to '...' | ||
| 2. Click on '....' | ||
| 3. Scroll down to '....' | ||
| 4. See error | ||
|
|
||
| **Expected behavior** | ||
| A clear and concise description of what you expected to happen. | ||
|
|
||
| **Screenshots** | ||
| If applicable, add screenshots to help explain your problem. | ||
|
|
||
| **Desktop (please complete the following information):** | ||
|
|
||
| - OS: [e.g. iOS] | ||
| - Browser [e.g. chrome, safari] | ||
| - Version [e.g. 22] | ||
|
|
||
| **Smartphone (please complete the following information):** | ||
|
|
||
| - Device: [e.g. iPhone6] | ||
| - OS: [e.g. iOS8.1] | ||
| - Browser [e.g. stock browser, safari] | ||
| - Version [e.g. 22] | ||
|
|
||
| **Additional context** | ||
| Add any other context about the problem here. | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,24 @@ | ||
| # To get started with Dependabot version updates, you'll need to specify which | ||
| # package ecosystems to update and where the package manifests are located. | ||
| # Please see the documentation for more information: | ||
| # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
| # https://containers.dev/guide/dependabot | ||
|
|
||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: 'devcontainers' | ||
| directory: '/' | ||
| schedule: | ||
| interval: weekly | ||
| target-branch: 'dev' | ||
| - package-ecosystem: 'npm' | ||
| directory: '/' | ||
| schedule: | ||
| interval: 'weekly' | ||
| open-pull-requests-limit: 10 | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| target-branch: 'dev' | ||
| labels: | ||
| - 'dependencies' | ||
| commit-message: | ||
| prefix: 'chore' | ||
| prefix-development: 'chore' | ||
| include: 'scope' | ||
| prefix: 'chore(deps)' |
This file contains hidden or 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,22 @@ | ||
| ## Summary | ||
|
|
||
| - What changed and why. | ||
|
|
||
| ## Changes | ||
|
|
||
| - List the primary changes in this PR. | ||
|
|
||
| ## Validation | ||
|
|
||
| - Describe checks run and results. | ||
|
|
||
| ## Risks | ||
|
|
||
| - Note behavior changes, regressions, or operational impact. | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Conventional commit(s) with gitemoji used | ||
| - [ ] Commit granularity is meaningful | ||
| - [ ] Tests and lint were run as appropriate | ||
| - [ ] Documentation updated if needed |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,120 @@ | ||
| name: Publish Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
htnabe marked this conversation as resolved.
|
||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: publish-main | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| prepare: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| should_publish: ${{ steps.release.outputs.should_publish }} | ||
| package_name: ${{ steps.release.outputs.package_name }} | ||
| package_version: ${{ steps.release.outputs.package_version }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: 1.2.0 | ||
|
|
||
| - name: Check release guard | ||
| id: release | ||
| env: | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| BEFORE_SHA: ${{ github.event.before }} | ||
| REF_NAME: ${{ github.ref }} | ||
| run: | | ||
| if [[ "$REF_NAME" != "refs/heads/main" ]]; then | ||
| echo "Publishing is only allowed from main" | ||
| exit 1 | ||
| fi | ||
|
|
||
| package_name=$(node -p "require('./package.json').name") | ||
| package_version=$(node -p "require('./package.json').version") | ||
|
|
||
| if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then | ||
| version_changed=true | ||
| elif [[ "$BEFORE_SHA" == "0000000000000000000000000000000000000000" ]]; then | ||
| version_changed=true | ||
| else | ||
| previous_version=$(git show "$BEFORE_SHA:package.json" | node -e \ | ||
| 'let input=""; process.stdin.on("data", chunk => input += chunk).on("end", () => console.log(JSON.parse(input).version))') | ||
| version_changed=$([[ "$package_version" != "$previous_version" ]] && echo true || echo false) | ||
| fi | ||
|
|
||
| if [[ "$version_changed" != true ]]; then | ||
| echo "No package version change; skipping publish" | ||
| echo "should_publish=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
|
|
||
| if npm view "$package_name@$package_version" version >/dev/null 2>&1; then | ||
| echo "$package_name@$package_version is already published" | ||
| echo "Do not reuse a published version; create a new version instead." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "should_publish=true" >> "$GITHUB_OUTPUT" | ||
| echo "package_name=$package_name" >> "$GITHUB_OUTPUT" | ||
| echo "package_version=$package_version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| publish: | ||
| needs: prepare | ||
| if: needs.prepare.outputs.should_publish == 'true' | ||
| runs-on: ubuntu-latest | ||
| environment: publish | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: 1.2.0 | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Run release checks | ||
| run: | | ||
| bun run lint | ||
| bun test | ||
| bun run build | ||
| bun pack --dry-run | ||
|
|
||
| - name: Publish to npm | ||
| env: | ||
| PACKAGE_VERSION: ${{ needs.prepare.outputs.package_version }} | ||
| run: | | ||
| npm_tag=latest | ||
| if [[ "$PACKAGE_VERSION" == *-* ]]; then | ||
| prerelease="${PACKAGE_VERSION#*-}" | ||
| prerelease="${prerelease%%.*}" | ||
| case "$prerelease" in | ||
| beta) | ||
| npm_tag=beta | ||
| ;; | ||
| rc) | ||
| npm_tag=rc | ||
| ;; | ||
| *) | ||
| npm_tag=next | ||
| ;; | ||
| esac | ||
| fi | ||
| bun publish --access public --tag "$npm_tag" | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.