Skip to content

Actions-fix GitHub Actions πŸš€ #49

Actions-fix GitHub Actions πŸš€

Actions-fix GitHub Actions πŸš€ #49

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@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle 🐘
uses: gradle/gradle-build-action@v2
- 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 ⬆️
if: ${{ github.event_name == 'pull_request' && github.pull_request_target == 'master' }}
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ./build/libs/saRestApi-*.jar
- uses: jfrog/setup-jfrog-cli@v3
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 --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 }}."