chore(ci): Unify release build command and artifact upload #3149
Workflow file for this run
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/** | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| job_build_upload: | |
| name: Build and upload distribution artifact | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout current commit (${{ github.sha }}) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # pin@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Build Gradle Plugin, Kotlin Compiler Plugin, and Snapshots Runtime distribution artifacts | |
| run: ./gradlew assemble | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| with: | |
| name: ${{ github.sha }} | |
| path: | | |
| ./*/build/distributions/*.zip | |
| - name: Verify artifact contents | |
| shell: bash | |
| run: | | |
| zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker" | grep -v ".tar") | |
| filename=${zipfile/\.zip/} | |
| unzip plugin-build/build/distributions/$filename.zip -d /tmp | |
| find /tmp/$filename | grep "pom-default.xml" | |
| unzip /tmp/$filename/$filename.jar -d /tmp/jar/ | |
| find /tmp/jar | grep "bin/sentry-cli" | |
| cat /tmp/$filename/pom-default.xml | grep -v "dev.gradleplugins" |