158/merge GitHub Actions π #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Create version for Artifactory | |
if: ${{ github.event_name == 'pull_request' && github.pull_request_target == 'master' }} | |
run: | | |
export BUILD_NAME="saidp-sdk-java" | |
export BUILD_MODULE="sdk-java" | |
export BUILD_NUMBER="1" | |
export VERSION="1.0.3.5" | |
jf rt upload "./build/libs/saRestApi-*.jar" radius-release-local/saRestApi/$PATH_TO_DIRECTORY --build-name $BUILD_NAME --build-number $BUILD_NUMBER --module $BUILD_MODULE | |
# This action publishes the build information to Artifactory and deletes older builds | |
- name: Publish to Artifactory | |
if: ${{ github.event_name == 'pull_request' && github.pull_request_target == 'master' }} | |
run: | | |
jf rt build-publish $BUILD_NAME $BUILD_NUMBER | |
- run: echo "π This job's status is ${{ job.status }}." |