-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (58 loc) · 2.23 KB
/
publish-client.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
name: Publish client
on:
workflow_dispatch:
jobs:
release-version:
uses: ./.github/workflows/release-version.yml
secrets: inherit
publish-to-npm-registry:
runs-on: ubuntu-latest
needs: release-version
env:
AWS_REGION: eu-west-3
steps:
###############################################################
########## GENERATE AND PUBLISH TYPESCRIPT CLIENT #############
###############################################################
- uses: actions/checkout@v4.1.6
- name: Set up JDK 21
uses: actions/setup-java@v4.2.1
with:
java-version: '21'
distribution: 'corretto'
- name: Read gradle.properties file
id: extract_version
run: |
version=$(grep -oP 'version=\K[^ ]+' gradle.properties)
echo "::set-output name=version::$version"
- name: Generate typescript client
run: ./gradlew generateTsClient -Pargs=${{ steps.extract_version.outputs.version }}
- name: install-aws-cli
uses: unfor19/install-aws-cli-action@v1.0.3
with:
version: 2
verbose: false
arch: amd64
rootdir: ''
workdir: ''
- uses: hei-school/aws-credentials-setter@v1.0.3
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}
- name: Configure npm client to connect to Codeartifact
run: |
sh ./.shell/initNpmrc.sh annotator-imagery-store npm-bpartners-imagery-app 205205101409 eu-west-3
- name: Setup Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: 17.x
- name: Publish Typescript client
run: |
cd build/gen-ts/
sed -i "s/\"https:\/\/annotator-api.preprod.bpartners.app\"/\(process.env.REACT_APP_BPARTNERS_ANNOTATOR_API_URL || \"\"\)/g" base.ts
sed -i "s/\"dependencies\"/\"peerDependencies\"/g" package.json
sed -i '11d' tsconfig.json && sed -i "s/\"es6\",/\"es6\",\"DOM\"/g" tsconfig.json
echo -e "\n*.ts\nnode_module\n!*.d.ts\n.idea\n.vscode\n.openapi-generator\n.openapi-generator-ignore\ngit_push.sh" >> .npmignore
npm config set always-auth true
npm install
npm publish