-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.62 KB
/
dev-deploy.yaml
File metadata and controls
83 lines (70 loc) · 2.62 KB
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
name: Codegen generation For Dev
on:
workflow_dispatch:
inputs:
run_id:
description: "Optional Run ID for specific artifact. Leave blank to use from the latest webapp deployment."
required: false
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Generate unique branch name
run: |
BRANCH_NAME="dev_$(date +'%Y%m%d%H%M%S')"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "RELEASE_VERSION=$BRANCH_NAME" >> $GITHUB_ENV
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Create and checkout unique branch
run: |
git checkout -b ${{ env.BRANCH_NAME }}
- name: Download the swagger spec
uses: dawidd6/action-download-artifact@v6
with:
repo: ${{ secrets.REPO }}
github_token: ${{ secrets.ARTIFACT_READ_ONLY }}
run_id: ${{ github.event.inputs.run_id || '' }}
workflow: statflo-webapp-deploy.yaml
name: webapp-artifact
path: ./webapp-artifact/
workflow_conclusion: success
- name: Generate code from Swagger file
run: |
rm -f README.md
java -jar ./bin/swagger-codegen-cli-3.0.62.jar generate \
-i ./webapp-artifact/nelmio-spec.json \
-l java \
-o . \
-t ./templates \
--invoker-package com.statflo.client \
--model-package com.statflo.client.model \
--api-package com.statflo.client.api \
--additional-properties groupId=com.statflo,artifactId=statflo-java-sdk,releaseVersion=${{ env.RELEASE_VERSION }} \
-D dateLibrary=java8
- name: Commit and Push to unique branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Generate SDK for Dev (version: ${{ env.RELEASE_VERSION }})"
git push origin ${{ env.BRANCH_NAME }}
- name: Deployment Summary
if: success()
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
## 🚀 Deployment Summary
| Property | Value |
|----------|--------|
| Version | ${{ env.RELEASE_VERSION }}-SNAPSHOT |
### 📦 Maven Dependency
\`\`\`xml
<dependency>
<groupId>com.github.Statflo</groupId>
<artifactId>statflo-java-sdk</artifactId>
<version>${{ env.RELEASE_VERSION }}-SNAPSHOT</version>
</dependency>
\`\`\`
EOF