Skip to content

Commit 00de80a

Browse files
committed
prepare for gh-releases
1 parent 086b254 commit 00de80a

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

.github/workflows/check.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: QC
2+
3+
on:
4+
pull_request:
5+
branches: ['**']
6+
types: [synchronize, opened, reopened, ready_for_review]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
if: github.event.pull_request.draft == false # run this job only if the PR is not in a draft state
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- uses: actions/setup-node@v2
19+
id: setup-node
20+
with:
21+
cache: 'npm'
22+
node-version: '14.18.2'
23+
24+
- run: npm i
25+
26+
- name: lint
27+
run: ./node_modules/.bin/prettier --check **/*.ts

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: QC & Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish_release_artifacts:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- uses: actions/setup-node@v2
15+
id: setup-node
16+
with:
17+
cache: 'npm'
18+
node-version: '14.18.2'
19+
20+
- run: npm i
21+
22+
- name: Build
23+
run: |
24+
set -e # fail with non-zero exit code on error
25+
tsc
26+
tar --exclude="*.tsbuildinfo" --exclude="examples" -czvf build.tar.gz -C build .
27+
echo 'created build.tar.gz'
28+
29+
- name: Upload Release Asset
30+
id: upload-release-asset
31+
uses: actions/upload-release-asset@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.PRIVATE_DEPENDENCIES_PAT }}
34+
with:
35+
upload_url: ${{ github.event.release.upload_url }}
36+
asset_path: ./build.tar.gz
37+
asset_name: docupilot-js-sdk.es5.zip
38+
asset_content_type: application/zip

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ dist
106106
# intellij
107107
.idea
108108

109+
build

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/* Basic Options */
66
"incremental": true, /* Enable incremental compilation */
7-
"target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
7+
"target": "ES5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
88
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
99
// "lib": [], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -70,5 +70,5 @@
7070
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
7171
"resolveJsonModule": false
7272
},
73-
"exclude": ["node_modules", "test", "**/*.spec.ts"]
73+
"exclude": ["node_modules", "test", "build" ,"**/*.spec.ts"]
7474
}

0 commit comments

Comments
 (0)