diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97ea80b345..9dee765357 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,21 +65,27 @@ jobs: - name: Docker Pull short-sha run: docker pull $REGISTRY/$GITHUB_REPOSITORY:${{ steps.vars.outputs.sha_short }} - name: Semantic Release + id: semantic uses: cycjimmy/semantic-release-action@v2 with: dry_run: false semantic_version: 17.0.4 - extra_plugins: | - @semantic-release/exec@5.0.0 + - name: Do something when a new release published + if: steps.semantic.outputs.new_release_published == 'true' + run: | + echo ${{ steps.semantic.outputs.new_release_version }} + echo ${{ steps.semantic.outputs.new_release_major_version }} + echo ${{ steps.semantic.outputs.new_release_minor_version }} + echo ${{ steps.semantic.outputs.new_release_patch_version }} - name: Docker Tag Version - run: docker tag $REGISTRY/$GITHUB_REPOSITORY:${{ steps.vars.outputs.sha_short }} $REGISTRY/$GITHUB_REPOSITORY:$CAOS_NEXT_VERSION - if: env.CAOS_NEXT_VERSION != '' + run: docker tag $REGISTRY/$GITHUB_REPOSITORY:${{ steps.vars.outputs.sha_short }} $REGISTRY/$GITHUB_REPOSITORY:${{ steps.semantic.outputs.new_release_version }} + if: steps.semantic.outputs.new_release_published == 'true' - name: Docker Tag Latest run: docker tag $REGISTRY/$GITHUB_REPOSITORY:${{ steps.vars.outputs.sha_short }} $REGISTRY/$GITHUB_REPOSITORY:latest - if: env.CAOS_NEXT_VERSION != '' + if: steps.semantic.outputs.new_release_published == 'true' - name: Docker Push Version - run: docker push $REGISTRY/$GITHUB_REPOSITORY:$CAOS_NEXT_VERSION - if: env.CAOS_NEXT_VERSION != '' + run: docker push $REGISTRY/$GITHUB_REPOSITORY:${{ steps.semantic.outputs.new_release_version }} + if: steps.semantic.outputs.new_release_published == 'true' - name: Docker Push Latest run: docker push $REGISTRY/$GITHUB_REPOSITORY:latest - if: env.CAOS_NEXT_VERSION != '' \ No newline at end of file + if: steps.semantic.outputs.new_release_published == 'true' diff --git a/.releaserc.js b/.releaserc.js index 5c80756feb..e1e3a2d036 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -3,9 +3,6 @@ module.exports = { plugins: [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", - "@semantic-release/github", - ["@semantic-release/exec", { - "publishCmd": "echo '::set-env name=CAOS_NEXT_VERSION::${nextRelease.version}'" - }], + "@semantic-release/github" ] -}; \ No newline at end of file +};