diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9be205f..70d86ad 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,15 +3,7 @@ version: 2 updates: - # Maintain dependencies for Gradle dependencies - package-ecosystem: "gradle" directory: "/" - target-branch: "next" - schedule: - interval: "daily" - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - target-branch: "next" schedule: interval: "daily" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8787abf..c3dcf0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,13 +14,7 @@ ## JBIJPPTPL name: Build -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: - +on: [push, pull_request] jobs: # Run Gradle Wrapper Validation Action to verify the wrapper's checksum @@ -31,11 +25,11 @@ jobs: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 # Validate wrapper - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 + uses: gradle/wrapper-validation-action@v1.0.3 # Run verifyPlugin and test Gradle tasks test: @@ -46,25 +40,24 @@ jobs: # Setup Java 1.8 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 8 + java-version: 11 # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 # Cache Gradle dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v2 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@v2.1.6 + uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -92,25 +85,24 @@ jobs: # Setup Java 1.8 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 8 + java-version: 11 # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v2 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@v2.1.6 + uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -122,23 +114,25 @@ jobs: run: | PROPERTIES="$(./gradlew properties --console=plain -q)" VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" - NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" + NAME="$(echo "$PROPERTIES" | grep "^pluginName_:" | cut -f2- -d ' ')" CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" CHANGELOG="${CHANGELOG//'%'/'%25'}" CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" ARTIFACT="${NAME}-${VERSION}.zip" + echo "::set-output name=version::$VERSION" echo "::set-output name=name::$NAME" echo "::set-output name=changelog::$CHANGELOG" echo "::set-output name=artifact::$ARTIFACT" + # Build artifact using buildPlugin Gradle task - name: Build Plugin run: ./gradlew buildPlugin # Upload plugin artifact to make it available in the next jobs - name: Upload artifact - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v1 with: name: plugin-artifact path: ./build/distributions/${{ steps.properties.outputs.artifact }} @@ -153,25 +147,24 @@ jobs: # Setup Java 1.8 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 8 + java-version: 11 # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v2 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@v2.1.6 + uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -183,11 +176,13 @@ jobs: 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@v2.1.6 + uses: actions/cache@v2 with: path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }} @@ -207,7 +202,7 @@ jobs: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 # Remove old release drafts by using the curl request for the available releases with draft flag - name: Remove Old Release Drafts @@ -219,10 +214,11 @@ jobs: | 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.1.4 + uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -240,11 +236,11 @@ jobs: # Upload artifact as a release asset - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.2 + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.createDraft.outputs.upload_url }} asset_path: ./${{ needs.build.outputs.artifact }} asset_name: ${{ needs.build.outputs.artifact }} - asset_content_type: application/zip \ No newline at end of file + asset_content_type: application/zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43b292a..a7afcbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,14 +16,13 @@ jobs: # Setup Java 1.8 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 8 + java-version: 11 # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: ref: ${{ github.event.release.tag_name }} @@ -42,14 +41,13 @@ jobs: # Setup Java 1.8 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 8 + java-version: 11 # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: ref: ${{ github.event.release.tag_name }} @@ -63,9 +61,10 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git commit -m "Update changelog" -a + # Push changes - name: Push changes uses: ad-m/github-push-action@master with: branch: main - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }}