Release 0.17.0 #278
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- 'README.md' | |
- '.idea/**' | |
- 'images/**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
verify-gradle-wrapper: | |
name: Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Gradle Wrapper Validation | |
uses: gradle/actions/wrapper-validation@v3 | |
build: | |
name: Build Plugin | |
needs: verify-gradle-wrapper | |
runs-on: ubuntu-latest | |
outputs: | |
name: ${{ steps.properties.outputs.name }} | |
version: ${{ steps.properties.outputs.version }} | |
artifact: ${{ steps.properties.outputs.name }}-${{ steps.properties.outputs.version }}.zip | |
changelog: ${{ steps.properties.outputs.changelog }} | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Restore Gradle Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.npm | |
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/build.gradle.kts') }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-npm | |
- name: Export Properties | |
id: properties | |
run: | | |
echo "::set-output name=version::$(./gradlew properties --console=plain -q | grep "^version:" | awk '{printf $2}')" | |
echo "::set-output name=name::$(./gradlew properties --console=plain -q | grep "^name:" | awk '{printf $2}')" | |
- name: Build Plugin | |
run: ./gradlew :plugin:buildPlugin | |
# - name: Verify Plugin | |
# run: ./gradlew runPluginVerifier | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: plugin-artifact | |
path: ./plugin/build/distributions/${{ steps.properties.outputs.name }}-${{ steps.properties.outputs.version }}.zip | |
# If accepted and published, release workflow would be triggered | |
release-draft: | |
name: Create Release Draft | |
if: github.ref == 'refs/heads/master' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
# 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/{} | |
# Download plugin artifact provided by the previous job | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: plugin-artifact | |
path: plugin-artifact | |
# Upload artifact as a release asset | |
- name: Create Release Draft | |
id: upload-release-asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: ./plugin-artifact/${{ needs.build.outputs.artifact }} | |
fail_on_unmatched_files: true | |
draft: true | |
name: v${{ needs.build.outputs.version }} | |
tag_name: v${{ needs.build.outputs.version }} |