version #55
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: true | |
push: | |
tags: | |
- 'v*.*' | |
jobs: | |
greet: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set LD_VERSION | |
if: ${{ github.event_name == 'push'}} | |
run: echo "LD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
- name: Set LD_VERSION | |
if: ${{ github.event_name == 'workflow_dispatch'}} | |
run: echo "LD_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
- name: Set PUBLISH_TOKEN | |
run: echo "PUBLISH_TOKEN=${{ secrets.PUBLISH_TOKEN }}" >> $GITHUB_ENV | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build the plugin | |
run: ./gradlew publishPlugin | |
env: | |
LD_VERSION: ${{ env.LD_VERSION }} | |
PUBLISH_TOKEN: ${{ env.PUBLISH_TOKEN }} | |
# - name: Verify plugin | |
# id: verify | |
# uses: ChrisCarini/[email protected] | |
# with: | |
# failure-levels: | | |
# INVALID_PLUGIN | |
# ide-versions: | | |
# ideaIC:2020.3 | |
# ideaIC:LATEST-EAP-SNAPSHOT | |
# - name: Print verify contents | |
# run: | | |
# echo "The log file path is: ${{steps.verify.outputs.verification-output-log-filename}}" ; | |
# cat ${{steps.verify.outputs.verification-output-log-filename}} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.LD_VERSION }} | |
release_name: v${{ env.LD_VERSION }} | |
draft: true | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./build/distributions/leetcode-editor-${{ env.LD_VERSION }}.zip | |
asset_name: leetcode-editor-${{ env.LD_VERSION }}.zip | |
asset_content_type: application/zip |