Skip to content

Commit 5cddb50

Browse files
committed
add release pipeline
1 parent 23c6438 commit 5cddb50

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node-version: [16]
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
with:
17+
ref: main
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v2
21+
with:
22+
version: 8
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'pnpm'
29+
registry-url: 'https://registry.npmjs.org'
30+
31+
- name: Install dependencies
32+
run: pnpm install
33+
34+
- name: Set publishing config
35+
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
36+
env:
37+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
38+
39+
- name: Publish
40+
run: pnpm publish --tag latest --access=public

bin/release

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname "$0")"
4+
cd ..
5+
6+
set -e -o pipefail
7+
8+
version="v$(jq '.version' package.json -r)"
9+
10+
gh release create "$version"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-with-hoc",
33
"description": "React HOCs made easy and great",
4-
"version": "0.0.1",
4+
"version": "0.0.6-wip05",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.esm.mjs",
77
"umd:main": "dist/index.umd.js",

0 commit comments

Comments
 (0)