-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (46 loc) · 1.91 KB
/
github-actions.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
name: GitHub Actions
run-name: ${{ github.ref_name }} GitHub Actions 🚀
on: [push, pull_request]
jobs:
Build-Publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository code ⬇️
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle 🐘
uses: gradle/actions/setup-gradle@v3
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run build with Gradle Wrapper 🏃
run: ./gradlew build -x test
- name: Run tests 🧑⚕️
run: ./gradlew test
# Might want to remove this step
- name: Archive production artifacts ⬆️
# Changed from target 'master' to 'develop' because the rules for the repo are locking my uploads
if: github.event.pull_request.base.ref == 'develop'
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: ./build/libs/saRestApi-*.jar
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ secrets.ARTIFACTORY_URL }}
JF_USER: ${{ secrets.JFROG_USERNAME }}
JF_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
- run: |
# This command adds a new server configuration to the JFrog CLI
- name: Upload to artifactory
if: ${{ github.event_name == 'pull_request' }}
run: |
export BUILD_NAME="saidp-sdk-java"
export BUILD_MODULE="sdk-java"
export BUILD_NUMBER="1"
export VERSION=$(cat gradle.properties | grep -Po "\d*\.\d*\.\d*\.\d*")
jf rt upload "./build/libs/saRestApi-*.jar" radius-release-local/saRestApi/$VERSION/saRestApi-$VERSION.jar --build-name $BUILD_NAME --build-number $BUILD_NUMBER --module $BUILD_MODULE
jf rt build-publish $BUILD_NAME $BUILD_NUMBER
- run: echo "🍏 This job's status is ${{ job.status }}."