STUD-5585: Migrate to GHA #4
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: flip-tables CI | |
on: | |
pull_request: | |
branches: [ '*' ] | |
push: | |
branches: [ 'master' ] | |
tags: [ '*' ] | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
gradle-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '8' | |
- uses: gradle/actions/setup-gradle@v3 | |
- name: Build Release Version | |
if: ${{ github.ref_type == 'tag' }} | |
run: ./gradlew clean assemble --info -Dorg.gradle.project.version=${{ github.ref_name }} | |
- name: Build Non-Release Version | |
if: ${{ github.ref_type != 'tag' }} | |
run: ./gradlew clean assemble --info | |
- name: Bundle/TAR up JAR files | |
run: | | |
tar -cvzf ./build/libs/java.tar.gz ./build/libs/*.jar | |
ls -ls ./build/libs | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java | |
path: ./build/libs/flip-tables-*.*.jar | |
- name: Publish Snapshot | |
if: ${{ github.ref_type != 'tag' && github.ref_name != 'master' && hashFiles('./build/libs/*-SNAPSHOT.jar') != '' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java-snapshot | |
path: ./build/libs/*-SNAPSHOT.jar | |
Unit-Test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '8' | |
- uses: gradle/actions/setup-gradle@v3 | |
- name: Run Tests | |
run: ./gradlew --no-daemon --console=plain test |