-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 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,49 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: main | ||
push: | ||
branches: main | ||
merge_group: {} | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: pnpm | ||
|
||
- name: Install | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Start Docker Containers | ||
run: | | ||
docker compose up -d | ||
# Wait for services to be ready (optional) | ||
sleep 10 | ||
- name: Lint | ||
run: pnpm lint | ||
|
||
- name: Test | ||
run: pnpm test | ||
|
||
- name: Typecheck | ||
run: pnpm typecheck | ||
|
||
- name: Stop Docker Containers | ||
run: docker compose down | ||
|
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,64 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- run: npx changelogithub | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- uses: pnpm/action-setup@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Determine npm tag | ||
id: determine_npm_tag | ||
shell: bash | ||
run: | | ||
TAG="${GITHUB_REF#refs/tags/}" | ||
if [[ "$TAG" =~ -(next|canary|beta|rc) ]]; then | ||
# Extract pre-release tag (e.g., beta, rc) | ||
NPM_TAG=${BASH_REMATCH[1]} | ||
else | ||
# Check if the commit is on the main branch | ||
git fetch origin main | ||
if git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then | ||
NPM_TAG="latest" | ||
else | ||
echo "The tagged commit is not on the main branch." | ||
echo "::error ::Releases with the 'latest' npm tag must be on the main branch." | ||
exit 1 | ||
fi | ||
fi | ||
echo "npm_tag=$NPM_TAG" >> $GITHUB_OUTPUT | ||
echo "Using npm tag: $NPM_TAG" | ||
- name: Publish to npm | ||
run: pnpm -r publish --access public --no-git-checks --tag ${{ steps.determine_npm_tag.outputs.npm_tag }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |