Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
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.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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
Comment thread
htnabe marked this conversation as resolved.
Outdated
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.
23 changes: 18 additions & 5 deletions .github/dependabot.yml
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)'
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
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
59 changes: 0 additions & 59 deletions .github/workflows/ci.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Publish Release

on:
workflow_dispatch:
Comment thread
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"
57 changes: 0 additions & 57 deletions .github/workflows/release.yml

This file was deleted.

Loading
Loading