Edited And Merged Some files. NOT FINISHED YET. #1
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
# Used when a commit is pushed to the repository | |
# This makes use of caching for faster builds and uploads the resulting artifacts | |
name: Build - Commit | |
on: [ push ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ 17 ] | |
steps: | |
- name: Extract current branch name | |
shell: bash | |
# bash pattern expansion to grab branch name without slashes | |
run: ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT | |
id: ref | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-read-only: false | |
- name: Build w/ Gradle Wrapper | |
run: ./gradlew build | |
- name: Upload Build Artifacts | |
if: ${{ matrix.java == '17' }} # Only upload artifacts built from latest Java | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tacz-artifacts-${{ steps.ref.outputs.branch }} # Name the artifact with the branch name | |
path: build/libs/*.jar | |
dependency-submission: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. | |
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@v4 |