Merge pull request #23 from rcchopra/hyp-17516-v3 #11
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: Release | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| Release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Minor Label | |
| id: check_pr_labels_minor | |
| uses: shioyang/[email protected] | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| labels: '["release:minor"]' | |
| - name: Check Major Label | |
| id: check_pr_labels_major | |
| uses: shioyang/[email protected] | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| labels: '["release:major"]' | |
| - name: Release Type | |
| run: | | |
| if [ ${MAJOR} == "true" ] ; then | |
| echo "RELEASE_TYPE=major" >> $GITHUB_ENV | |
| elif [ ${MINOR} == "true" ] ; then | |
| echo "RELEASE_TYPE=minor" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE_TYPE=patch" >> $GITHUB_ENV | |
| fi | |
| env: | |
| MINOR: ${{ steps.check_pr_labels_minor.outputs.result }} | |
| MAJOR: ${{ steps.check_pr_labels_major.outputs.result }} | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/[email protected] | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| default_bump: ${{ env.RELEASE_TYPE }} | |
| - name: Creating Github Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| draft: false | |
| generateReleaseNotes: true | |
| prerelease: false | |
| tag: ${{ steps.tag_version.outputs.new_tag }} | |
| name: Release ${{ steps.tag_version.outputs.new_tag }} | |
| body: ${{ steps.changelog.outputs.changelog }} | |
| # Notifies on slack | |
| - uses: 8398a7/action-slack@v3 | |
| with: | |
| status: ${{ job.status }} | |
| fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | |
| author_name: GO SCM Releaser | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| if: always() |