Merge pull request #319 from Project-Env/dependabot/gradle/org.jetbra… #791
This file contains hidden or 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: Build | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
- uses: Project-Env/[email protected] | |
- run: | | |
echo "ORG_GRADLE_PROJECT_projectEnvCliUsername=${{ github.actor }}" >> $GITHUB_ENV | |
echo "ORG_GRADLE_PROJECT_projectEnvCliPassword=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "ORG_GRADLE_PROJECT_projectEnvCommonsJavaUsername=${{ github.actor }}" >> $GITHUB_ENV | |
echo "ORG_GRADLE_PROJECT_projectEnvCommonsJavaPassword=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- name: Export Artifact Name | |
id: artifact | |
run: | | |
PROPERTIES="$(gradle properties --console=plain -q)" | |
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" | |
ARTIFACT="${NAME}-dev.zip" | |
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT | |
- name: Run Linters and Test | |
run: gradle check koverXmlReport | |
- name: Build Plugin | |
run: gradle buildPlugin | |
- name: Upload Plugin | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
with: | |
name: ${{ steps.artifact.outputs.artifact }} | |
path: ./build/distributions/${{ steps.artifact.outputs.artifact }} | |
- name: Sonar | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
run: gradle sonar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |