Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 44 additions & 97 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,104 +3,51 @@ on:
push:
branches:
- 'master'
- 'develop'
- 'release/**'
- 'hotfix/**'
- 'ci/**'

jobs:
compile:
deploy:
if: startsWith(github.repository, 'noeppi-noeppi/') # don't run this in forks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Cache node_modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install

- run: yarn run compile

test:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12'

- name: Cache node_modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install

- run: yarn run test_coverage

lint:
if: contains(github.ref, 'refs/heads/develop') || contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/heads/hotfix') || contains(github.ref, 'refs/heads/ci')
needs: [compile,test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12'

- name: Cache node_modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install

- run: yarn run lint
- run: yarn run test
- run: |
npx @siliconjungles/rn-scripts commit_all "
repo=https://$GITHUB_ACTOR:${{secrets.GITHUB_TOKEN}}@github.com/$GITHUB_REPOSITORY.git
branch=${GITHUB_REF:11}
message=Automated Linting"

publish:
if: contains(github.ref, 'refs/heads/master')
needs: [compile, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12'

- name: Cache node_modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install

- run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public

- run: echo ::set-env name=VERSION_NAME::$(npx @siliconjungles/rn-scripts get_version_name)

- run: |
npx @siliconjungles/rn-scripts commit_tag "
tag=${{env.VERSION_NAME}}
repo=https://$GITHUB_ACTOR:${{secrets.GITHUB_TOKEN}}@github.com/$GITHUB_REPOSITORY.git
message=${{env.VERSION_NAME}}"
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: base

- name: 'Remove dist from gitignore'
shell: bash
working-directory: base
run: |
perl -i -ne 'print$_ unless/\/?dist\s*/' .gitignore

- name: 'Setup node'
uses: actions/setup-node@v2
with:
node-version: '16'

- name: 'Setup yarn'
shell: bash
run: sudo npm install -g yarn

- name: 'Installing dependencies'
shell: bash
working-directory: base
run: npx yarn install

- name: 'Compiling'
shell: bash
working-directory: base
run: |
npx yarn run compile
npx yarn run prepublish

- name: 'Push'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_message: Deploy
repository: base
branch: 'build'
skip_checkout: true
push_options: '--force'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
node_modules
dist
.idea
package-lock.json
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
"jest": "^24.9.0",
"prettier": "^1.19.1",
"ts-jest": "^24.2.0",
"typescript": "^3.7.4"
"typescript": "^4.5.5"
},
"meta": {
"npm_template_version": "0.1.5"
}
}

2 changes: 1 addition & 1 deletion src/Http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios, { AxiosInstance, AxiosResponse } from 'axios'
import qs from 'querystring'
import * as qs from 'querystring'
import { OAuth2Token } from './Token'

// TODO: Immutability
Expand Down
2 changes: 1 addition & 1 deletion src/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class OAuth2Token {

this.token = { ...data, ...{ expires_on: DateUtil.add(data.expires_in * 1000) } }
} catch (e) {
rethrow(new Error('Unable to obtain O2A token'), e)
rethrow(new Error('Unable to obtain O2A token'), e instanceof Error ? e : new Error(String(e)))
}
}

Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@

/* Advanced Options */
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
"resolveJsonModule": true,
"noUncheckedIndexedAccess": true
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3966,10 +3966,10 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==

typescript@^3.7.4:
version "3.7.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
typescript@^4.5.5:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==

uglify-js@^3.1.4:
version "3.7.2"
Expand Down