build: fix scripts permissions - take 2 #16
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: Build Plugin zip | |
on: | |
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests) | |
push: | |
branches: [ main ] | |
# Trigger the workflow on any pull request | |
pull_request: | |
jobs: | |
# Prepare environment and build the plugin | |
build-plugin: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
# Validate wrapper | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1.1.0 | |
# Set up Java environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
# Setup Gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
cache-read-only: false | |
# Build plugin | |
- name: Build plugin | |
run: | | |
./gradlew buildPlugin | |
# Prepare plugin archive content for creating artifact | |
- name: Prepare Plugin Artifact | |
id: artifact | |
shell: bash | |
run: | | |
cd ${{ github.workspace }}/build/distributions | |
FILENAME=`ls *.zip` | |
unzip "$FILENAME" -d content | |
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT | |
# Store already-built plugin as an artifact for downloading | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.artifact.outputs.filename }} | |
path: ./build/distributions/content/*/* |