2020-06-15 16:29:31 +00:00
|
|
|
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
|
2020-11-16 21:57:09 +00:00
|
|
|
name: release - Build and Publish
|
2020-06-15 16:29:31 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-11-16 21:57:09 +00:00
|
|
|
branches: [ release ]
|
2020-06-15 16:29:31 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-03 20:29:24 +00:00
|
|
|
timeout-minutes: 15
|
2020-06-15 16:29:31 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
registry-url: https://registry.npmjs.org/
|
|
|
|
- name: Build and WNS publish
|
|
|
|
run: |
|
2020-11-16 21:57:09 +00:00
|
|
|
git config --global user.email "npm@dxos.org"
|
2020-06-23 14:19:01 +00:00
|
|
|
git config --global user.name "DXOS"
|
2020-06-15 16:29:31 +00:00
|
|
|
|
|
|
|
yarn install
|
|
|
|
yarn build
|
|
|
|
yarn test
|
|
|
|
yarn lint
|
|
|
|
|
|
|
|
# Uncomment for NPM publishing.
|
2020-11-16 22:21:40 +00:00
|
|
|
VERSION="`cat lerna.json | grep '"version":' | awk '{ print $2 }' | sed 's/[",]//g' | cut -d'-' -f1`"
|
2020-11-16 23:36:27 +00:00
|
|
|
git push --delete origin "v$VERSION" || true
|
2020-11-16 21:57:09 +00:00
|
|
|
yarn lerna version $VERSION --no-git-tag-version -y
|
|
|
|
git commit -am "v$VERSION"
|
|
|
|
git push
|
|
|
|
git tag -f "v$VERSION"
|
|
|
|
git push --tags -f
|
|
|
|
yarn lerna publish from-package --force-publish -y
|
2020-06-15 16:29:31 +00:00
|
|
|
|
|
|
|
# Publish to WNS
|
2020-11-30 17:17:22 +00:00
|
|
|
yarn wire profile init --name $WIRE_PROFILE --template-url "$WIRE_PROFILE_URL"
|
2020-06-15 16:29:31 +00:00
|
|
|
scripts/deploy_apps_to_wns.sh
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
|
|
WIRE_WNS_USER_KEY: ${{secrets.wns_user_key}}
|
|
|
|
WIRE_WNS_BOND_ID: ${{secrets.wns_bond_id}}
|
2020-11-30 17:17:22 +00:00
|
|
|
WIRE_PROFILE_URL: ${{secrets.wire_profile_url}}
|
2020-06-15 16:29:31 +00:00
|
|
|
WIRE_PROFILE: ci
|