feat: init

This commit is contained in:
Morten Olsen
2023-09-06 10:56:36 +02:00
commit d6c7404f96
55 changed files with 6090 additions and 0 deletions

53
.github/release-drafter-config.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name-template: '$RESOLVED_VERSION 🚀'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'enhancement'
- 'feature'
patch:
labels:
- 'bug'
- 'chore'
- 'fix'
- 'bugfix'
default: patch
autolabeler:
- label: 'chore'
files:
- '*.md'
branch:
- '/docs{0,1}\/.+/'
- label: 'bug'
title:
- '/fix/i'
body:
- '/fix/i'
- label: 'enhancement'
title:
- '/feature/i'
- '/feat/i'
body:
- '/feature/i'
- '/feat/i'
template: |
## Changes
$CHANGES

21
.github/workflows/auto-label.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Auto Labeler
on:
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
auto-labeler:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-config.yml
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

100
.github/workflows/release-package.yml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Node.js Package
on:
push:
pull_request:
types: [opened]
# release:
# types: [created]
env:
NODE_CACHE: 'yarn'
NODE_VERSION: '20.x'
NODE_SCOPE: '@bob-the-algorithm'
NPM_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: '${{ env.NODE_CACHE }}'
node-version: '${{ env.NODE_VERSION }}'
scope: '${{ env.NODE_SCOPE }}'
- run: |
corepack enable
yarn run ci:install
yarn run ci:test
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: '${{ env.NODE_CACHE }}'
node-version: '${{ env.NODE_VERSION }}'
registry-url: '${{ env.NODE_REGISTRY_URL }}'
scope: '${{ env.NODE_SCOPE }}'
- run: |
corepack enable
pnpm run ci:install
pnpm run build
- uses: actions/upload-artifact@v3
with:
name: lib
retention-days: 5
path: |
packages/*/dist
packages/*/package.json
package.json
README.md
update-release-draft:
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pull-requests: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-config.yml
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
cache: '${{ env.NODE_CACHE }}'
node-version: '${{ env.NODE_VERSION }}'
scope: '${{ env.NODE_SCOPE }}'
- uses: actions/download-artifact@v3
with:
name: lib
path: ./
- run: |
pnpm run ci:install
git config user.name "Github Actions Bot"
git config user.email "<>"
pnpm version newversion $(git describe --tag --abbrev=0) --no-git-tag-version
pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}