forked from JakeWharton/flip-tables
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Workiva/STUD-5585-gha-migration
STUD-5585: Migrate to GHA
- Loading branch information
Showing
5 changed files
with
90 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Only allow Workiva employees to alter GHA workflows | ||
/.github/ @Workiva/cloud42 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
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: flip-tables | ||
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: flip-tables-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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish SBOM | ||
|
||
on: | ||
push: | ||
tags: | ||
# Releases | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
# Permissions should look like this | ||
permissions: | ||
contents: write | ||
id-token: write | ||
pull-requests: write | ||
|
||
jobs: | ||
create-sbom-release-asset: | ||
name: Create SBOM Release Asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
# If you don't check the code out, the SBOM will be empty | ||
- uses: actions/checkout@v4 | ||
- name: Publish SBOM to Release Assets | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
path: ./ # actions/checkout default location | ||
format: cyclonedx-json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.