Skip to content

Commit cdaab65

Browse files
committed
feat: add workflow file
1 parent fe7d09e commit cdaab65

2 files changed

Lines changed: 32 additions & 44 deletions

File tree

.github/workflows/publish.yml

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,23 @@
1+
name: Publish Package to npmjs
12
on:
2-
push:
3-
branches:
4-
- master
5-
3+
release:
4+
types: [created]
65
jobs:
7-
publish:
8-
name: Publish
6+
build:
97
runs-on: ubuntu-latest
10-
env:
11-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
8+
defaults:
9+
run:
10+
working-directory: packages/styled
1211
steps:
13-
14-
# 1. provide Personal Access Token for checkout@v2
15-
- name: Checkout
16-
uses: actions/checkout@v2
17-
with:
18-
token: ${{ secrets.GITHUB_TOKEN }}
19-
fetch-depth: 0
20-
21-
# 2. setup .npmrc it uses NODE_AUTH_TOKEN
22-
- name: Setup .npmrc file for publish
23-
uses: actions/setup-node@v2
24-
with:
25-
node-version: '14.x'
26-
registry-url: 'https://registry.npmjs.org'
27-
28-
# 3. configure git user used to push tag
29-
- name: Configure Git User
30-
run: |
31-
git config --global user.name 'github-actions[bot]'
32-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
33-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
- name: Install dependencies
37-
run: yarn install
38-
39-
- name: Publish
40-
run: |
41-
lerna publish from-git --yes
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: '12.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- run: yarn install --frozen-lockfile
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
- run: yarn build
21+
- run: npm publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/run-tests.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
name: Test Package
1+
name: Check typescript
22

33
on: [push]
44

55
jobs:
6-
test:
6+
build:
77
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: packages/styled
811
steps:
9-
- uses: actions/checkout@v1
10-
- uses: actions/setup-node@v1
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
1114
with:
12-
node-version: 14
13-
- run: yarn
14-
- run: yarn test:generate-output
15+
node-version: '12.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: Install dependencies
18+
run: yarn install --frozen-lockfile
19+
- name: Check TypeScript types
20+
run: yarn run tsc

0 commit comments

Comments
 (0)