Skip to content

Commit

Permalink
build: setup release with tsc build and semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomartinet committed Oct 30, 2024
1 parent 0ef85ec commit 85d8aa2
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release
run-name: 🔖 [${{ github.ref_name }}] Release

on:
push:
branches:
- main

permissions:
contents: read

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build
run: bun run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bunx semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,5 @@ dist

# Finder (MacOS) folder config
.DS_Store

lib
Binary file modified bun.lockb
Binary file not shown.
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
{
"name": "scriptools",
"version": "0.0.0",
"module": "lib/index.js",
"repository": "https://github.com/hugomartinet/scriptools",
"author": "Hugo Martinet",
"keywords": [
"node",
"script",
"scripting",
"logger"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib"
],
"scripts": {
"build": "rm -rf lib && tsc"
},
"devDependencies": {
"@types/bun": "latest",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"eslint": "^8.8.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-unused-imports": "^4.1.4"
"eslint-plugin-unused-imports": "^4.1.4",
"semantic-release": "^24.2.0"
},
"peerDependencies": {
"typescript": "^5.0.0"
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"noUncheckedIndexedAccess": true,
"declaration": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down

0 comments on commit 85d8aa2

Please sign in to comment.