-
Notifications
You must be signed in to change notification settings - Fork 72
86 lines (75 loc) · 2.53 KB
/
release-js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release Js
on:
workflow_dispatch
permissions:
contents: write
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Prettier
run: npm install prettier
- name: Install ESLint
run: >
npm install eslint@latest &&
npm install @microsoft/eslint-formatter-sarif@latest eslint-config-google@latest eslint-plugin-import@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest eslint-config-prettier@latest eslint-plugin-prettier@latest
- name: Get cache date
id: get-date
run: echo "name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: ESLint Cache
uses: actions/cache@v3
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
restore-keys: |
${{ runner.os }}-eslintcache-
- name: Run ESLint
run: npx eslint JS
--fix
--cache
--config JS/.eslintrc.js
--ext .js,.jsx,.ts,.tsx
continue-on-error: true
- name: Run Prettiers
run: npx prettier --tab-width 4 --print-width 100 --trailing-comma es5 --ignore-path "$(CURDIR)/node_modules/*" --write JS/
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatically applying Prettier changes
commit_user_name: GitHub Actions
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>
branch: ${{ github.head_ref }}
release:
name: release-js
needs: formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Goto JS folder
run: cd JS/edgechains/lib
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
working-directory: JS/edgechains/lib
- name: Build edgechain-app project
run: npm run build
working-directory: JS/edgechains/lib
- name: Package edgechain-app project
run: npm pack
working-directory: JS/edgechains/lib
- name: Upload release Tarball
uses: actions/upload-artifact@v3
with:
name: release-artifact
path: 'JS/edgechains/lib/*.tgz'