diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml index 5ba45792b..91b090fdf 100644 --- a/.github/workflows/publish-cli.yml +++ b/.github/workflows/publish-cli.yml @@ -17,12 +17,18 @@ jobs: service_account_key: ${{ secrets.GCR_JSON_KEY }} export_default_credentials: true + - uses: haya14busa/action-cond@v1 + id: condval + with: + cond: ${{ github.ref == 'refs/heads/main' }} + if_true: "patch" + if_false: "prepatch" + - name: Auto Increment Semver Action uses: MCKanpolat/auto-semver-action@1.0.5 id: versioning with: - releaseType: patch # TODO: should be by branch master=minor other=patch - incrementPerCommit: false + releaseType: ${{ steps.condval.outputs.value }} github_token: ${{ secrets.GITHUB_TOKEN }} - name: Get base image name @@ -34,10 +40,11 @@ jobs: id: version_parameters - name: Build and Push CLI run: make push-cli SEM_VER='${{ steps.versioning.outputs.version }}' BUILD_TIME_UTC='${{ steps.version_parameters.outputs.build_time_utc }}' BUILD_TIMESTAMP='${{ steps.version_parameters.outputs.build_timestamp }}' - - if: github.ref == 'refs/heads/main' + - name: publish + # if: github.ref == 'refs/heads/main' uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} artifacts: "cli/bin/*" commit: ${{ steps.version_parameters.outputs.branch }} - tag: ${{ steps.version_parameters.outputs.version }} \ No newline at end of file + tag: ${{ steps.versioning.outputs.version }} \ No newline at end of file