Skip to content

Release

Release #13

Workflow file for this run

# GitHub Actions Workflow created for handling the release process based on the draft release prepared
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
name: Release
on:
release:
types: [ prereleased, released ]
jobs:
# Prepare and publish the plugin to the Marketplace repository
release:
name: Publish Plugin
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/[email protected]
with:
ref: ${{ github.event.release.tag_name }}
- name: Download JBR
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://cache-redirector.jetbrains.com/intellij-jbr/jbr-17.0.5-linux-x64-b653.14.tar.gz'
file-name: 'jbr-17.0.5.tar.gz'
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: jdkfile
jdkFile: jbr-17.0.5.tar.gz
cache: gradle
# Update Unreleased section with the current release note
- name: Patch Changelog
run: |
./gradlew patchChangelog --release-note="`cat << EOM
${{ github.event.release.body }}
EOM`"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- uses: ButterCam/setup-sisyphus-build@v1
with:
dependency-repositories: local,central,portal,google,snapshot
snapshot-url: https://s01.oss.sonatype.org/content/repositories/snapshots
snapshot-username: ${{ secrets.OSSRH_USERNAME }}
snapshot-password: ${{ secrets.OSSRH_PASSWORD }}
release-url: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2
release-username: ${{ secrets.OSSRH_USERNAME }}
release-password: ${{ secrets.OSSRH_PASSWORD }}
gradle-portal-key: ${{ secrets.GRADLE_PUBLISH_KEY }}
gradle-portal-secret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
gpg-key-name: ${{ secrets.GPG_KEY_NAME }}
# Publish the plugin to the Marketplace
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: ./gradlew publish
# Upload artifact as a release asset
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./**/build/libs/*
# Create pull request
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ github.event.release.tag_name }}"
BRANCH="changelog-update-$VERSION"
git config user.email "[email protected]"
git config user.name "GitHub Action"
git checkout -b $BRANCH
git commit -am "Changelog update - $VERSION"
git push --set-upstream origin $BRANCH
gh pr create \
--title ":bookmark: Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--base main \
--head $BRANCH