mirror of
https://github.com/Lucaslah/No-Report-Button.git
synced 2026-01-02 19:47:51 +00:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
|
|
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
|
|
|
- name: Build
|
|
run: ./gradlew build
|
|
|
|
- name: Set Commit SHA
|
|
id: commit_short_sha
|
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Find Build Artifacts
|
|
run: |
|
|
mkdir -p artifacts
|
|
|
|
find . -type d -path '*/build/libs' | while read -r dir; do
|
|
project_name=$(basename "$(dirname "$(dirname "$dir")")")
|
|
mkdir -p "artifacts/$project_name"
|
|
cp -r "$dir"/* "artifacts/$project_name/"
|
|
done
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: 'NRB-Build-${{ steps.commit_short_sha.outputs.sha_short }}'
|
|
path: 'artifacts/'
|