From e7bbd24057b03989d1daad67dddf5fe36eb6a08b Mon Sep 17 00:00:00 2001 From: Grirgory Rylov Date: Mon, 4 Aug 2025 07:18:47 +0300 Subject: [PATCH 1/2] build on PR --- .github/workflows/build-plugin.yml | 36 ++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/build-plugin.yml diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml new file mode 100644 index 0000000..b5ae464 --- /dev/null +++ b/.github/workflows/build-plugin.yml @@ -0,0 +1,36 @@ +name: Build Plugin + +on: + push: + branches: + - '**' + pull_request: + types: [closed] + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew buildPlugin + + - name: Upload plugin artifact + uses: actions/upload-artifact@v4 + with: + name: plugin-artifact + path: plugin/build/distributions/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1d145d2..281277e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea .gradle *.iml +.intellijPlatform build/ out local.properties From f6314cf680880daef159e4b676f96131a2b6f720 Mon Sep 17 00:00:00 2001 From: Grirgory Rylov Date: Mon, 4 Aug 2025 07:25:52 +0300 Subject: [PATCH 2/2] push to releases on pr merge --- .github/workflows/build-plugin.yml | 41 +++++++++++++++++++++++------- gradle.properties | 2 +- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index b5ae464..4c6c74a 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -1,16 +1,14 @@ -name: Build Plugin +name: Build and Release Plugin on: - push: - branches: - - '**' pull_request: types: [closed] branches: - - '**' + - master jobs: build: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: @@ -29,8 +27,33 @@ jobs: - name: Build plugin run: ./gradlew buildPlugin - - name: Upload plugin artifact - uses: actions/upload-artifact@v4 + - name: Get version from gradle.properties + id: get_version + run: | + version=$(grep '^yampVersion=' gradle.properties | cut -d'=' -f2) + echo "version=$version" >> $GITHUB_OUTPUT + + - name: Rename plugin artifact + run: | + mv plugin/build/distributions/*.zip plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.get_version.outputs.version }} + release_name: Release v${{ steps.get_version.outputs.version }} + draft: false + prerelease: false + + - name: Upload plugin artifact to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: plugin-artifact - path: plugin/build/distributions/ \ No newline at end of file + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip + asset_name: yamp_plugin_${{ steps.get_version.outputs.version }}.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index df33612..0cab4d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ studioCompilePath=/Applications/Android Studio.app/Contents pluginGroup = com.github.grishberg pluginName = android-methods-profiler -yampVersion = 25.08.03 +yampVersion = 25.08.04 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions.