Publish testar-cli asset to latest release #2
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: TESTAR-CLI distribution | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main_dev | |
| jobs: | |
| build-cli-distribution: | |
| name: Build testar-cli distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the TESTAR_dev repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: corretto | |
| java-version: '17' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build testar-cli distribution | |
| run: ./gradlew :cli:cliDistribution -x test | |
| - name: Upload testar-cli zip artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testar-cli-distribution | |
| path: cli/target/distributions/testar-cli.zip | |
| if-no-files-found: error | |
| - name: Publish testar-cli asset to latest release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG_NAME=$(gh release view --repo "${{ github.repository }}" --json tagName --jq .tagName) | |
| gh release upload "$TAG_NAME" cli/target/distributions/testar-cli.zip --clobber --repo "${{ github.repository }}" |