Skip to content

Release

Release #53

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
# Fetch all history.
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Prepare release name
run: |
VERSION_NAME=$(grep "^VERSION_NAME=" gradle.properties | cut -d '=' -f 2)
IS_SNAPSHOT=false
if [[ $VERSION_NAME == *-SNAPSHOT ]]; then
IS_SNAPSHOT=true
else
IS_SNAPSHOT=false
fi
echo "VERSION_NAME=$VERSION_NAME"
echo "IS_SNAPSHOT=$IS_SNAPSHOT"
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "IS_SNAPSHOT=$IS_SNAPSHOT" >> $GITHUB_ENV
- name: Build signed plugin
run: ./gradlew signPlugin
- name: Verify IntelliJ plugin
# https://www.jetbrains.com/idea/download/other.html
uses: ChrisCarini/[email protected]
with:
plugin-location: idea-plugin/build/distributions/*-signed.zip
# We can't verify all revisions due to the disk size limitation on GHA.
ide-versions: |
ideaIC:2024.1.6
ideaIC:2024.2.4
ideaIC:2024.3
failure-levels: |
COMPATIBILITY_WARNINGS
COMPATIBILITY_PROBLEMS
DEPRECATED_API_USAGES
OVERRIDE_ONLY_API_USAGES
NON_EXTENDABLE_API_USAGES
PLUGIN_STRUCTURE_WARNINGS
MISSING_DEPENDENCIES
INVALID_PLUGIN
NOT_DYNAMIC
- name: Publish to Marketplace
if: env.IS_SNAPSHOT == 'false'
run: ./gradlew publishPlugin
- name: Build CLI
run: ./gradlew buildCLI
- name: Delete release if exist then create a new one
run: |
gh release view ${{ env.VERSION_NAME }} && gh release delete ${{ env.VERSION_NAME }} -y --cleanup-tag
# Create a pre-release if it's a snapshot version.
if [[ ${{ env.IS_SNAPSHOT }} == "true" ]]; then
PRE_RELEASE_FLAG="--prerelease"
else
PRE_RELEASE_FLAG=""
# Delete last snapshot if it exists to make sure `--generate-notes` works correctly.
gh release view ${{ env.VERSION_NAME }}-SNAPSHOT && gh release delete ${{ env.VERSION_NAME }}-SNAPSHOT -y --cleanup-tag
fi
gh release create ${{ env.VERSION_NAME }} idea-plugin/build/distributions/*-signed.zip cli/build/distributions/*.zip --generate-notes $PRE_RELEASE_FLAG