name: Release on: push: branches: - master jobs: release: runs-on: ubuntu-latest if: | startsWith(github.event.commits[0].message, 'fix(deps): update renovate/renovate docker tag ') steps: - name: Checkout uses: actions/checkout@v2.1.0 with: fetch-depth: 0 - name: Fetch tags run: git fetch --tags - name: Setup Git user run: | git config --local user.name "github-actions[bot]" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Setup node uses: actions/setup-node@v1.4.1 with: node-version: '12.x' - name: Install project run: npm ci - name: Release run: | SEMVER_REGEX="v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)" if [[ ! "${{ github.event.commits[0].message }}" =~ ${SEMVER_REGEX} ]]; then echo Not a semver like version - aborting: ${1} exit 1 fi "::set-env name=NEXT_VERSION::${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" readonly COMMIT_MESSAGE="${{ github.event.commits[0].message }}" npx --no-install standard-version - name: Publish release run: git push --follow-tags - name: Publish GitHub release uses: actions/create-release@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: v${{ env.NEXT_VERSION }} release_name: v${{ env.NEXT_VERSION }} body: | See the the [changelog]( https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md ) for the changes included in this release. prevent_failed_status: name: Prevent failed status when skipped runs-on: ubuntu-latest steps: - name: Prevent failed status when skipped run: | echo "Run this job to prevent the workflow status from showing as" \ "failed when all other jobs are skipped."