From f5afec3a48a383ad4a191850f7e91738a9fb790c Mon Sep 17 00:00:00 2001 From: SerVB Date: Tue, 20 Oct 2020 18:23:23 +0300 Subject: [PATCH] Publish agent --- .github/workflows/release-agent.yml | 46 +++++++++++++++++++++++++++++ projector-agent/build.gradle | 9 ++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/release-agent.yml diff --git a/.github/workflows/release-agent.yml b/.github/workflows/release-agent.yml new file mode 100644 index 00000000..3326e9ed --- /dev/null +++ b/.github/workflows/release-agent.yml @@ -0,0 +1,46 @@ +name: Upload Release Asset (agent) + +on: + push: + tags: + - "agent-v*" + +jobs: + main: + name: Upload Release Asset (agent) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Java 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + - name: Build project + run: | + ./gradlew :projector-plugin:buildPlugin + cd projector-plugin/build/distributions + find . -maxdepth 1 -type f -name projector-plugin-*.zip -exec mv {} projector-plugin.zip \; + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Tag name # Inspired from https://github.community/t/how-to-get-just-the-tag-name/16241/11 + id: tag_name + run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: Upload Release Asset (agent) + 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 }} + asset_path: projector-plugin/build/distributions/projector-plugin.zip + asset_name: projector-plugin-${{ steps.tag_name.outputs.SOURCE_TAG }}.zip + asset_content_type: application/zip diff --git a/projector-agent/build.gradle b/projector-agent/build.gradle index 0acee183..1d7903cb 100644 --- a/projector-agent/build.gradle +++ b/projector-agent/build.gradle @@ -1,5 +1,14 @@ plugins { id("org.jetbrains.kotlin.jvm") + id("maven-publish") +} + +publishing { + publications { + maven(MavenPublication) { + from components.java + } + } } def agentClassName = "org.jetbrains.projector.agent.MainAgent"