Skip to content

Commit a2d741d

Browse files
committed
ci: add publish workflow
1 parent a210b21 commit a2d741d

File tree

3 files changed

+67
-10
lines changed

3 files changed

+67
-10
lines changed

.github/workflows/publish.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags-ignore:
7+
- '**'
8+
paths-ignore:
9+
- '**/*.gitignore'
10+
- .editorconfig
11+
- docs/**
12+
- examples/**
13+
- website/**
14+
- scripts/**
15+
pull_request: null
16+
jobs:
17+
publish:
18+
name: Publish
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
id-token: write
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: pnpm/action-setup@v2
26+
- name: Setup node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 20
30+
check-latest: true
31+
cache: 'pnpm'
32+
registry-url: 'https://registry.npmjs.org'
33+
- name: Install the latest npm
34+
run: npm install -g npm
35+
- name: Install dependencies
36+
run: pnpm install
37+
- name: Run build
38+
run: pnpm run build
39+
- name: Run lint
40+
run: pnpm run lint
41+
- name: Publish
42+
run: |
43+
if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+$";
44+
then
45+
pnpm --filter "./packages/*" publish --provenance --access public
46+
elif git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+-beta\.[0-9]\+$";
47+
then
48+
pnpm --filter "./packages/*" publish --provenance --access public --tag beta
49+
elif git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+";
50+
then
51+
pnpm --filter "./packages/*" publish --provenance --access public --tag next
52+
else
53+
echo "Not a release, skipping publish"
54+
fi
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
NPM_CONFIG_PROVENANCE: true

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@
7575
"effect": "2.0.0-next.59",
7676
"eslint": ">=8.55.0",
7777
"eslint-config-with-tsconfig": "2.9.130",
78-
"eslint-plugin-eslint-plugin": "5.1.1",
78+
"eslint-plugin-eslint-plugin": "5.2.0",
7979
"eslint-plugin-filenames-simple": "0.9.0",
8080
"eslint-plugin-functional": "6.0.0",
8181
"eslint-plugin-functional-core": "1.7.1",
8282
"eslint-plugin-jsdoc": "46.9.0",
8383
"eslint-plugin-total-functions": "7.1.0",
84-
"eslint-plugin-vitest": "0.3.13",
84+
"eslint-plugin-vitest": "0.3.15",
8585
"fast-equals": "5.0.1",
8686
"fast-glob": "3.3.2",
8787
"husky": "8.0.3",

pnpm-lock.yaml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)