Skip to content

Commit

Permalink
Fix draft release title
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Komissarov committed May 14, 2024
1 parent 2895de4 commit ad65abe
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 41 deletions.
49 changes: 28 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
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:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

# Prepare environment and build the plugin
build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -18,39 +21,44 @@ jobs:
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
uses: gradle/wrapper-validation-action@v2

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
distribution: zulu
java-version: 17

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
chmod +x ./gradlew
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
./gradlew listProductsReleases
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Build plugin
- name: Build plugin
run: ./gradlew buildPlugin

# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
Expand All @@ -61,57 +69,56 @@ jobs:
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload Artifact
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*

- name: Create Draft Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases --jq '.[] | select(.draft == true) | .id' | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
gh release create "v${{ needs.build.outputs.version }}" --draft --title "v${{ needs.build.outputs.version }}"
gh release upload "v${{ needs.build.outputs.version }}" ${{ github.workspace }}/build/distributions/${{ steps.artifact.outputs.filename }}.zip
# Run plugin structure verification along with IntelliJ Plugin Verifier
verify:
name: Verify Plugin
name: Verify plugin
needs: [ build ]
runs-on: ubuntu-latest
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
distribution: zulu
java-version: 17

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v4
with:
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: |
chmod +x ./gradlew
./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish
on:
release:
types:
- released

jobs:

# Prepare and publish the plugin
release:
name: Publish Plugin
runs-on: ubuntu-latest
permissions:
contents: write
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Build plugin
- name: Build plugin
run: |
./gradlew buildPlugin
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/build/distributions/${{ steps.artifact.outputs.filename }}.zip
asset_name: ${{ steps.artifact.outputs.filename }}.zip
tag: ${{ github.ref }}
overwrite: true
13 changes: 13 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Create draft release"

on:
push:
branches: [ "main" ]

jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 20 additions & 20 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
pluginVersion=1.0.4
pluginGroup=ru.testit.management
pluginName=testit_management
pluginRepositoryUrl=https://github.com/testit-tms/testit-management/
pluginSinceBuild=231
pluginUntilBuild=241.*
platformType=IC
platformVersion=2024.1.1
platformPlugins=
javaEncoding=UTF-8
javaVersion=17
kotlin.code.style=official
kotlin.stdlib.default.dependency=false
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.warning.mode=all
org.gradle.welcome=never
org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
pluginVersion = 1.0.5
pluginGroup = ru.testit.management
pluginName = testit_management
pluginRepositoryUrl = https://github.com/testit-tms/testit-management/
pluginSinceBuild = 231
pluginUntilBuild = 241.*
platformType = IC
platformVersion = 2024.1.1
platformPlugins =
javaEncoding = UTF-8
javaVersion = 17
kotlin.code.style = official
kotlin.stdlib.default.dependency = false
org.gradle.caching = true
org.gradle.configuration-cache = true
org.gradle.configureondemand = true
org.gradle.parallel = true
org.gradle.warning.mode = all
org.gradle.welcome = never
org.gradle.jvmargs = -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC

0 comments on commit ad65abe

Please sign in to comment.