-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): refactor automatic release using GH actions (#283)
- Loading branch information
Showing
6 changed files
with
81 additions
and
166 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build, Test and Publish | ||
on: [push, workflow_dispatch] | ||
jobs: | ||
build-test-publish: | ||
env: | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
GH_TOKEN: ${{secrets.GH_TOKEN}} | ||
GH_USER: ${{secrets.GH_USER}} | ||
GH_EMAIL: ${{secrets.GH_EMAIL}} | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn bootstrap | ||
- run: yarn build | ||
- run: yarn test:integration | ||
- run: yarn lint | ||
- run: npx codecov | ||
|
||
- name: setup git coordinates | ||
run: | | ||
git remote set-url origin https://uport-project:$GH_TOKEN@github.com/uport-project/daf.git | ||
git config user.name $GH_USER | ||
git config user.email $GH_EMAIL | ||
- name: setup npm registry | ||
run: | | ||
echo "registry=https://registry.npmjs.org/" > .npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | ||
npm whoami | ||
- name: publish @latest when on main | ||
if: github.ref == 'refs/heads/main' | ||
run: yarn publish:latest | ||
|
||
- name: publish @next when on next | ||
if: github.ref == 'refs/heads/next' | ||
run: yarn publish:next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Sync @next with @latest | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
jobs: | ||
merge-branch: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: everlytic/branch-merge@1.1.0 | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
source_ref: ${{ github.ref }} | ||
target_branch: 'next' | ||
commit_message_template: 'chore(ci): merge main into next' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'subject-case': [2, 'always', ['sentence-case']], | ||
// 'subject-case': [2, 'always', ['sentence-case']], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters