Skip to content

Commit

Permalink
Merge pull request #1 from acrois/lifecycle
Browse files Browse the repository at this point in the history
ci: build, test, release lifecycle
  • Loading branch information
acrois authored Mar 9, 2024
2 parents 0cfa0b8 + c05948d commit 1c83c7b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
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 }}

0 comments on commit 1c83c7b

Please sign in to comment.