Publish Plugin to Jetbrains #51
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: Publish Plugin to Jetbrains | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Write Gradle Properties File | |
uses: joutvhu/write-file@v1 | |
with: | |
path: gradle.properties | |
contents: ${{ secrets.GRADLE_IDEA_PROPERTIES }} | |
write_mode: overwrite | |
- name: Get Current Release | |
id: current_release | |
uses: joutvhu/get-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build with Gradle | |
run: gradle clean buildPlugin | |
- name: Publish Plugin to Jetbrains | |
if: ${{ steps.current_release.outputs.draft == 'false' }} | |
run: gradle publishPlugin | |
- name: Get Plugin File | |
id: get_file | |
run: echo ::set-output name=plugin_file::$(find dart-scripts-*.zip) | |
working-directory: ./build/distributions | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.current_release.outputs.upload_url }} | |
asset_name: ${{ steps.get_file.outputs.plugin_file }} | |
asset_path: ./build/distributions/${{ steps.get_file.outputs.plugin_file }} | |
asset_content_type: application/zip |