From 8cefb7872ba9a25c09e176fd0649da335fca3c3f Mon Sep 17 00:00:00 2001 From: Firdaus Alghifari Date: Sat, 9 May 2020 16:58:35 +0700 Subject: [PATCH] edit ci/cd script --- .github/workflows/continuous_integration.yml | 4 +- .github/workflows/publish_to_npm.yml | 60 ++++++++++++-------- package.json | 2 +- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 710cf45..e80ffc7 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -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 diff --git a/.github/workflows/publish_to_npm.yml b/.github/workflows/publish_to_npm.yml index be001a7..078268a 100644 --- a/.github/workflows/publish_to_npm.yml +++ b/.github/workflows/publish_to_npm.yml @@ -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}} diff --git a/package.json b/package.json index 13b6801..37bbe1f 100644 --- a/package.json +++ b/package.json @@ -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",