add publish github action
This commit is contained in:
parent
5fdabe6612
commit
465fd59cbc
48
.github/workflows/publish.yml
vendored
Normal file
48
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ci_status:
|
||||
description: 'required CI status'
|
||||
default: 'success'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'check successful status'
|
||||
run: |
|
||||
REF_STATUS=$(curl -s \
|
||||
'https://api.github.com/repos/${{ github.repository }}/commits/${{ github.ref }}/status' \
|
||||
| jq .state)
|
||||
[[ "${REF_STATUS}" == '"${{ github.event.inputs.ci_status }}"' ]] || \
|
||||
(echo "::error ::${{ github.ref }} does not have a successful CI status" && false)
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: 'development'
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
node-version: 10
|
||||
- name: 'configure git'
|
||||
run: |
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git config --global user.name "Github Actions"
|
||||
- name: 'install dependencies'
|
||||
run: |
|
||||
yarn -D
|
||||
- name: 'build and publish'
|
||||
run: |
|
||||
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
|
||||
npm run run:publish:gha
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
- name: 'merge into main branch'
|
||||
run: |
|
||||
git checkout main && \
|
||||
git merge ${{ github.ref }} && \
|
||||
git push
|
@ -20,8 +20,10 @@
|
||||
"test:publish:circleci": "yarn npm-cli-login -u test -p test -e test@example.com -r http://localhost:4873 && IS_LOCAL_PUBLISH=true run-s script:publish test:installation:local",
|
||||
"run:publish": "run-s install:all script:prepublish_checks rebuild script:publish",
|
||||
"run:publish:local": "IS_LOCAL_PUBLISH=true yarn run:publish",
|
||||
"run:publish:gha": "run-s install:all rebuild script:publish:gha",
|
||||
"script:prepublish_checks": "node ./node_modules/@0x/monorepo-scripts/lib/prepublish_checks.js",
|
||||
"script:publish": "node ./node_modules/@0x/monorepo-scripts/lib/publish.js --repo protocol",
|
||||
"script:publish:gha": "node ./node_modules/@0x/monorepo-scripts/lib/publish.js --repo tools --auto-commit --no-upload-docs --yes",
|
||||
"install:all": "yarn install",
|
||||
"wsrun": "wsrun",
|
||||
"lerna": "lerna",
|
||||
@ -64,7 +66,7 @@
|
||||
"ignoreDependencyVersionsForPackage": "contract-wrappers"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/monorepo-scripts": "^2.0.3",
|
||||
"@0x/monorepo-scripts": "^2.0.4",
|
||||
"@0x-lerna-fork/lerna": "3.16.10",
|
||||
"@0xproject/npm-cli-login": "^0.0.11",
|
||||
"async-child-process": "^1.1.1",
|
||||
|
@ -912,10 +912,10 @@
|
||||
web3-providers "^2.0.0-alpha.1"
|
||||
websocket "^1.0.29"
|
||||
|
||||
"@0x/monorepo-scripts@^2.0.3":
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@0x/monorepo-scripts/-/monorepo-scripts-2.0.3.tgz#4766b31329e9323eceb34abedbcff4113ffeb2d1"
|
||||
integrity sha512-jqycycIFZb+5g1Am9sOCHojXpqHx+7RPzjx3d4X/X0rQ6C/kct9dcSnWcMxStb9G411BcKjSpkTuW3c1FQeGIg==
|
||||
"@0x/monorepo-scripts@^2.0.4":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@0x/monorepo-scripts/-/monorepo-scripts-2.0.4.tgz#26e5d868197e371408a400b22768ef7840d83c0c"
|
||||
integrity sha512-swxC+UZFdAKgcCrVpWmgydLNJXdOdTE5g6kiGIsiHMWBxIfAVjbXnHCpri6VYX16Jk2iu04F3STFJ0QlhfQmCA==
|
||||
dependencies:
|
||||
"@0x/types" "^3.2.4"
|
||||
"@0x/utils" "^5.6.3"
|
||||
|
Loading…
x
Reference in New Issue
Block a user