Skip to content

Commit

Permalink
fix: add publish config (#9)
Browse files Browse the repository at this point in the history
- github actions publish and test
- d2 as peer and dev dependency
  • Loading branch information
jenniferarnesen authored Aug 12, 2020
1 parent 0f1e551 commit 86f0f2f
Show file tree
Hide file tree
Showing 4 changed files with 2,277 additions and 2,313 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/node-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'dhis2: publish (node)'

on:
push:
branches:
# match branches in:
# https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches
- master
- next
- next-major
- alpha
- beta
- '[0-9]+.x'
- '[0-9]+.x.x'
- '[0-9]+.[0-9]+.x'

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: 'apps@dhis2.org'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: 'apps@dhis2.org'
NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}}
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}

jobs:
publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Test
run: yarn test

- name: Publish to NPM
run: npx @dhis2/cli-utils release --publish npm
env:
CI: true
24 changes: 24 additions & 0 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'dhis2: test (node)'

on: push

jobs:
unit:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install
run: yarn install --frozen-lockfile

- name: Lint
run: |
yarn lint
- name: Test
run: yarn test
env:
CI: true
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
"version": "1.0.0",
"description": "",
"license": "BSD-3-Clause",
"private": true,
"main": "build/cjs/lib.js",
"module": "build/es/lib.js",
"private": false,
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"repository": "git@github.com:dhis2/app-runtime-adapter-d2.git",
"scripts": {
"build": "d2-app-scripts build",
"start": "d2-app-scripts start",
Expand All @@ -19,16 +24,18 @@
"@testing-library/jest-dom": "^5.11.2",
"@testing-library/react": "^10.4.8",
"@testing-library/react-hooks": "^3.4.1",
"d2": "^31.8.1",
"mutation-observer": "^1.0.3",
"react-test-renderer": "^16.13.1"
"react-test-renderer": "^16.8"
},
"dependencies": {
"@dhis2/ui-core": "^4.6.1",
"d2": "^31.8.1",
"prop-types": "^15.7.2"
},
"peerDependencies": {
"@dhis2/app-runtime": "^2.0.4",
"d2": "^31.8.1"
"@dhis2/app-runtime": "^2",
"d2": ">30",
"react": "^16.8",
"react-dom": "^16.8"
}
}
Loading

0 comments on commit 86f0f2f

Please sign in to comment.