Skip to content

Commit d98b6f2

Browse files
committed
feat(workflows): create and set it up
1 parent bc635fb commit d98b6f2

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
permissions: {} # reset
11+
12+
jobs:
13+
release:
14+
name: Release
15+
# IMPORTANT: prevent this action from running on forks
16+
if: github.repository == 'victormicco/todoroki'
17+
permissions:
18+
contents: write # to create release (changesets/action)
19+
pull-requests: write # to create pull request (changesets/action)
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
node-version: [lts/*]
24+
steps:
25+
- name: Checkout Repo
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- uses: pnpm/action-setup@v3
31+
with:
32+
version: 8.15.5
33+
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
cache: "pnpm"
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile --ignore-scripts
42+
43+
- name: Build project
44+
run: pnpm run build
45+
46+
- name: Publish to npm
47+
id: changesets
48+
uses: changesets/action@v1
49+
with:
50+
publish: pnpm release
51+
commit: "chore: new release"
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
dist
2+
dist
3+
.env

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
"main": "index.js",
88
"scripts": {
99
"dev": "tsc -w",
10-
"build": "tsc",
10+
"build": "tsup",
1111
"postbuild": "echo '#!/usr/bin/env node' | cat - dist/index.js > temp && mv temp dist/index.js",
1212
"link-cli": "(yarn --global unlink practice-cli || true) && chmod +x ./dist/index.js && yarn --global link",
13-
"lint": "pnpm biome check --write"
13+
"lint": "pnpm biome check --write",
14+
"release": "pnpm build && changeset publish"
1415
},
1516
"keywords": [],
1617
"author": "victormicco",

src/templates/backend/fastify/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"test:debug": "vitest --inspect-brk --inspect --logHeapUsage --threads=false",
1717
"test:e2e": "vitest run --config ./vitest-e2e-config.ts",
1818
"type-check": "tsc"
19+
1920
},
2021
"devDependencies": {
2122
"@biomejs/biome": "^1.6.3",

0 commit comments

Comments
 (0)