Skip to content
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

ci: build, test, release lifecycle #1

Merged
merged 3 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: CI Build
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
- "**"
# - main
# - master
# - trunk
tags:
- "!**"
# Run every time a PR is updated
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +32,7 @@ jobs:
- id: install-deps
name: Install dependencies
run: |
bun install
bun install --frozen-lockfile
- id: test
name: Run tests
run: |
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Commit Lint
on:
pull_request:
branches:
- main
- master
- trunk
jobs:
conventions:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Code
- uses: webiny/[email protected]
name: Validate Commits
# optional, required for private repos:
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- id: setup-bun
name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- id: install-deps
name: Install dependencies
run: |
bun install --frozen-lockfile
- id: build
name: Build library
run: |
bun run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}