Skip to content

Bump gradle/wrapper-validation-action from 1.1.0 to 3.5.0 #341

Bump gradle/wrapper-validation-action from 1.1.0 to 3.5.0

Bump gradle/wrapper-validation-action from 1.1.0 to 3.5.0 #341

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build
on: [push, pull_request]
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v3.5.0
# Run verifyPlugin and test Gradle tasks
test:
name: Test
needs: gradleValidation
runs-on: ubuntu-latest
env:
ORG_GRADLE_PROJECT_ideaVersion: "${{ matrix.idea_version }}"
ORG_GRADLE_PROJECT_phpPluginVersion: "${{ matrix.php_plugin_version }}"
ORG_GRADLE_PROJECT_psiViewerPluginVersion: "${{ matrix.psi_viewer_plugin_version }}"
ORG_GRADLE_PROJECT_grammarKitPluginVersion: "${{ matrix.grammar_kit_plugin_version }}"
ORG_GRADLE_PROJECT_customSinceBuild: "${{ matrix.since_build }}"
ORG_GRADLE_PROJECT_customUntilBuild: "${{ matrix.until_build }}"
strategy:
matrix:
include:
- idea_version: "IU-2022.3"
php_plugin_version: "223.7571.231"
psi_viewer_plugin_version: "223-SNAPSHOT"
grammar_kit_plugin_version: "2021.2.2"
since_build: "223"
until_build: "223.*"
- idea_version: "IU-2023.1"
php_plugin_version: "231.8109.199"
psi_viewer_plugin_version: "231-SNAPSHOT"
grammar_kit_plugin_version: "2021.2.2"
since_build: "231"
until_build: "231.*"
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-${{ matrix.idea_version }}-${{ matrix.php_plugin_version }}-gradle-caches-${{ hashFiles('**/*.gradle', 'gradle.properties') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.idea_version }}-${{ matrix.php_plugin_version }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# Run detekt, ktlint and tests
- name: Run Linters and Test
run: ./gradlew check
# Run verifyPlugin Gradle task
- name: Verify Plugin
run: ./gradlew verifyPlugin
build:
name: Build
needs: test
env:
ORG_GRADLE_PROJECT_ideaVersion: "${{ matrix.idea_version }}"
ORG_GRADLE_PROJECT_phpPluginVersion: "${{ matrix.php_plugin_version }}"
ORG_GRADLE_PROJECT_psiViewerPluginVersion: "${{ matrix.psi_viewer_plugin_version }}"
ORG_GRADLE_PROJECT_grammarKitPluginVersion: "${{ matrix.grammar_kit_plugin_version }}"
ORG_GRADLE_PROJECT_customSinceBuild: "${{ matrix.since_build }}"
ORG_GRADLE_PROJECT_customUntilBuild: "${{ matrix.until_build }}"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- idea_version: "IU-2022.3"
php_plugin_version: "223.7571.231"
psi_viewer_plugin_version: "223-SNAPSHOT"
grammar_kit_plugin_version: "2021.2.2"
since_build: "223"
until_build: "223.*"
- idea_version: "IU-2023.1"
php_plugin_version: "231.8109.199"
psi_viewer_plugin_version: "231-SNAPSHOT"
grammar_kit_plugin_version: "2021.2.2"
since_build: "231"
until_build: "231.*"
outputs:
cms-name: ${{ steps.properties.outputs.cms-name }}
fluid-name: ${{ steps.properties.outputs.fluid-name }}
typoscript-name: ${{ steps.properties.outputs.typoscript-name }}
version: ${{ steps.properties.outputs.version }}
prefixed-version: ${{ steps.properties.outputs.prefixed-version }}
changelog: ${{ steps.properties.outputs.changelog }}
cms-artifact: ${{ steps.properties.outputs.cms-artifact }}
fluid-artifact: ${{ steps.properties.outputs.fluid-artifact }}
typoscript-artifact: ${{ steps.properties.outputs.typoscript-artifact }}
steps:
- uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-${{ matrix.idea_version }}-${{ matrix.php_plugin_version }}-gradle-caches-${{ hashFiles('**/*.gradle', 'gradle.properties') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.idea_version }}-${{ matrix.php_plugin_version }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^pluginVersion:" | cut -f2- -d ' ')"
CUSTOM_SINCE_BUILD="$(echo "$PROPERTIES" | grep "^customSinceBuild:" | cut -f2- -d ' ')"
PREFIXED_VERSION="$(echo ${CUSTOM_SINCE_BUILD}${VERSION:1})"
CMS_NAME="$(echo "$PROPERTIES" | grep "^pluginNameCMS:" | cut -f2- -d ' ')"
FLUID_NAME="$(echo "$PROPERTIES" | grep "^pluginNameFluid:" | cut -f2- -d ' ')"
TYPOSCRIPT_NAME="$(echo "$PROPERTIES" | grep "^pluginNameTypoScript:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew :getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
CMS_ARTIFACT="${CMS_NAME}-${PREFIXED_VERSION}.zip"
FLUID_ARTIFACT="${FLUID_NAME}-${PREFIXED_VERSION}.zip"
TYPOSCRIPT_ARTIFACT="${TYPOSCRIPT_NAME}-${PREFIXED_VERSION}.zip"
echo "::set-output name=version::$VERSION"
echo "::set-output name=prefixed-version::$PREFIXED_VERSION"
echo "::set-output name=cms-name::$CMS_NAME"
echo "::set-output name=fluid-name::$FLUID_NAME"
echo "::set-output name=typoscript-name::$TYPOSCRIPT_NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=cms-artifact::$CMS_ARTIFACT"
echo "::set-output name=fluid-artifact::$FLUID_ARTIFACT"
echo "::set-output name=typoscript-artifact::$TYPOSCRIPT_ARTIFACT"
# Build artifact using buildPlugin Gradle task
- name: Build Plugin
shell: bash
run: |
# Set output from previous step
export "ORG_GRADLE_PROJECT_pluginVersion=${{ steps.properties.outputs.prefixed-version }}"
./gradlew buildPlugin
# Upload plugin artifact to make it available in the next jobs
- name: Upload CMS artifact
uses: actions/upload-artifact@v3
with:
name: cms-plugin-artifact-${{ matrix.since_build }}
path: ./typo3-cms/build/distributions/${{ steps.properties.outputs.cms-artifact }}
if-no-files-found: error
- name: Upload Fluid artifact
uses: actions/upload-artifact@v3
with:
name: fluid-plugin-artifact-${{ matrix.since_build }}
path: ./lang-fluid/build/distributions/${{ steps.properties.outputs.fluid-artifact }}
if-no-files-found: error
- name: Upload TypoScript artifact
uses: actions/upload-artifact@v3
with:
name: typoscript-plugin-artifact-${{ matrix.since_build }}
path: ./lang-typoscript/build/distributions/${{ steps.properties.outputs.typoscript-artifact }}
if-no-files-found: error
# Verify built plugin using IntelliJ Plugin Verifier tool
# Requires build job to be passed
verify:
name: Verify
needs: build
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3.3.1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
echo "::set-output name=ideVersions::$IDE_VERSIONS"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v3.3.1
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
releaseDraft:
name: Release Draft
if: github.event_name != 'pull_request' # && github.ref == 'refs/heads/master'
needs: [ build, verify ]
runs-on: ubuntu-latest
outputs:
release-url: ${{ steps.createDraft.outputs.upload_url }}
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
| tr '\r\n' ' ' \
| jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' \
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{}
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
id: createDraft
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.build.outputs.version }}
release_name: v${{ needs.build.outputs.version }}
body: ${{ needs.build.outputs.changelog }}
draft: true