Skip to content

Commit 965f59c

Browse files
author
Michael Dougall
committed
feat: adds publish workflow
1 parent 36c6c65 commit 965f59c

3 files changed

Lines changed: 63 additions & 3 deletions

File tree

.github/workflows/npmpublish.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
14+
- name: Get yarn cache
15+
id: yarn-cache
16+
run: echo "::set-output name=dir::$(yarn cache dir)"
17+
18+
- uses: actions/cache@v1
19+
with:
20+
path: ${{ steps.yarn-cache.outputs.dir }}
21+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-yarn-
24+
25+
- name: Install packages
26+
run: yarn
27+
28+
- name: Build sources
29+
run: yarn build
30+
31+
publish-npm:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v1
36+
- uses: actions/setup-node@v1
37+
with:
38+
node-version: 12
39+
registry-url: https://registry.npmjs.org/
40+
- name: Publish to npm registry
41+
run: npm publish
42+
env:
43+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
44+
45+
publish-gpr:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v1
50+
- uses: actions/setup-node@v1
51+
with:
52+
node-version: 12
53+
registry-url: https://npm.pkg.github.com/
54+
scope: '@compiled'
55+
- name: Publish to github registry
56+
run: npm publish
57+
env:
58+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Change Log
22

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3+
This project adheres to [Semantic Versioning 2.0](http://semver.org/).
4+
All release notes and upgrade notes can be found on our [Github Releases](https://github.com/compiled/css-in-js/releases) page.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"test:cover": "jest --collectCoverage",
2020
"build": "tsc --module commonjs",
2121
"build:inspect": "node --inspect-brk node_modules/typescript/lib/tsc.js --module commonjs",
22-
"build-storybook": "build-storybook"
22+
"build-storybook": "build-storybook",
23+
"preversion": "yarn test && yarn build",
24+
"postversion": "git push && git push --tags"
2325
},
2426
"dependencies": {
2527
"stylis": "^3.5.4",

0 commit comments

Comments
 (0)