Skip to content

Commit 3316143

Browse files
oluwolenpbcoluwolenpbc
and
oluwolenpbc
authored
PLT-683 publish ab2d-libs (#1434)
## 🎫 Ticket https://jira.cms.gov/browse/PLT-683 ## 🛠 Changes Creating a new github workflow for AB2D-Libs build ## ℹ️ Context We are moving AB2D libs build workflow to github actions from jenkins ## 🧪 Validation This will be tested in this PR --------- Co-authored-by: oluwolenpbc <[email protected]>
1 parent b816b43 commit 3316143

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/publish-libs.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: publish
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
inputs:
7+
environment:
8+
required: true
9+
type: string
10+
module:
11+
required: true
12+
type: string
13+
workflow_dispatch:
14+
inputs:
15+
environment:
16+
required: true
17+
type: choice
18+
options:
19+
- dev
20+
- test
21+
module:
22+
required: true
23+
type: choice
24+
options:
25+
- api
26+
- worker
27+
28+
jobs:
29+
publish:
30+
runs-on: self-hosted
31+
32+
env:
33+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
34+
AWS_REGION: ${{ vars.AWS_REGION }}
35+
DEPLOYMENT_ENV: ${{ vars[format('{0}_DEPLOYMENT_ENV', inputs.environment)] }}
36+
37+
steps:
38+
- name: Checkout AB2D-Libs Repository
39+
uses: actions/checkout@v4
40+
with:
41+
repository: 'cmsgov/AB2D-Libs'
42+
43+
- name: Set up JDK
44+
uses: actions/setup-java@v3
45+
with:
46+
java-version: '17'
47+
distribution: 'adopt'
48+
49+
- name: Set env vars from AWS params
50+
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main
51+
env:
52+
AWS_REGION: ${{ vars.AWS_REGION }}
53+
with:
54+
params: |
55+
ARTIFACTORY_URL=/artifactory/url
56+
ARTIFACTORY_USER=/artifactory/user
57+
ARTIFACTORY_PASSWORD=/artifactory/password
58+
59+
60+
- name: Set up Gradle
61+
uses: gradle/gradle-build-action@v2
62+
with:
63+
gradle-version: '7.5'
64+
65+
66+
- name: Publish Libraries
67+
run: |
68+
echo "Publishing libraries using Gradle..."
69+
gradle artifactoryPublish -b build.gradle --info \
70+
-Dusername="${ARTIFACTORY_USER}" \
71+
-Dpassword="${ARTIFACTORY_PASSWORD}" \
72+
-Drepository_url="${ARTIFACTORY_URL}"

0 commit comments

Comments
 (0)