Skip to content

Commit

Permalink
edit ci/cd script
Browse files Browse the repository at this point in the history
  • Loading branch information
falghi committed May 9, 2020
1 parent 4562ed3 commit 8cefb78
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2

- name: Install Dependencies
run: npm install
run: npm ci

- name: Test
run: npm run test
run: npm test
60 changes: 37 additions & 23 deletions .github/workflows/publish_to_npm.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
name: NPM Publish

on:
push:
branches:
- master
release:
types: [created]

jobs:
npm-publish:
name: NPM Publish
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test

- name: Install Dependencies
run: npm install
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 10.0.0

- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
with:
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jasper-ui",
"version": "0.1.2",
"description": "Jasper is a Modern React Component Library",
"author": "itdevcompfest",
"author": "COMPFEST",
"license": "MIT",
"repository": "COMPFEST/jasper",
"main": "dist/index.js",
Expand Down

0 comments on commit 8cefb78

Please sign in to comment.