Skip to content

Commit bcd263b

Browse files
setup automatic publish (#197)
1 parent 0f4c4b2 commit bcd263b

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to NPM
2+
on:
3+
push:
4+
tags:
5+
- 'v[0-9]+.[0-9]+.[0-9]+*'
6+
permissions: {}
7+
jobs:
8+
ci:
9+
permissions:
10+
contents: read # for actions/checkout
11+
security-events: write # for codeql-action
12+
uses: ./.github/workflows/ci.yml
13+
14+
npm-publish:
15+
environment:
16+
name: npm-publish
17+
url: https://www.npmjs.com/package/graphql-faker/v/${{github.ref_name}}
18+
needs: ci
19+
permissions:
20+
contents: read # for actions/checkout
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repo
24+
uses: actions/checkout@v3
25+
with:
26+
persist-credentials: false
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
cache: npm
32+
node-version-file: '.node-version'
33+
# 'registry-url' is required for 'npm publish'
34+
registry-url: 'https://registry.npmjs.org'
35+
36+
- uses: actions/download-artifact@v3
37+
with:
38+
name: npmDist
39+
path: npmDist
40+
41+
- name: Publish package on NPM
42+
run: npm publish ./npmDist
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"node": ">= 18.12.0"
2222
},
2323
"scripts": {
24+
"preversion": "npm ci --ignore-scripts && npm test",
2425
"test": "npm run lint && npm run check && npm run prettier:check && npm run check:spelling",
2526
"lint": "eslint --cache --max-warnings 0 .",
2627
"check": "tsc --noEmit",

src/editor/icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react'
1+
import * as React from 'react';
22

33
export const EditIcon = () => (
44
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">

0 commit comments

Comments
 (0)