Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ZxBing0066 committed Dec 5, 2019
1 parent 7ceac44 commit 925608a
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

[package.json]
indent_size = 2
[{package.json,*.yml}]
indent_size = 2
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Build

on: [push]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
- name: Run build
run: npm build
- name: Run build lib
run: npm run build:lib
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
- name: Run build
run: npm build
- name: Run build lib
run: npm run build:lib
103 changes: 65 additions & 38 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,72 @@
name: Publish

on:
release:
types: [created]
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
- run: npm ci
- run: npm test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
env:
runs-on: ubuntu-latest
steps:
- name: Echo env info
run: npm ci

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://npm.pkg.github.com/
scope: "@rapiop"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
publish-npm:
needs: env
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: env
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://npm.pkg.github.com/
scope: "@rapiop"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

publish-release:
needs: [publish-npm, publish-gpr]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
17 changes: 10 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Test

on: [push]
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Run test
run: npm test
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 8
- name: Run test
run: npm test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"build:lib": "rm -rf lib/ && babel src/ -d lib/ -x \".js\",\".ts\" --source-maps",
"stats": "NODE_ENV=production webpack --profile --json > stats.json",
"analyzer": "ANALYZER=true NODE_ENV=production webpack",
"ci": "node --version && babel --version",
"before-publish": "npm run build && npm run build:lib",
"publish:patch": "npm run before-publish && npm version patch && npm publish",
"publish:minor": "npm run before-publish && npm version minor && npm publish",
Expand Down

0 comments on commit 925608a

Please sign in to comment.