Skip to content

Merge pull request #1870 from reviewdog/renovate/golang.org-x-build-d… #56

Merge pull request #1870 from reviewdog/renovate/golang.org-x-build-d…

Merge pull request #1870 from reviewdog/renovate/golang.org-x-build-d… #56

Workflow file for this run

name: release
on:
push:
branches:
- master
- release-*
tags:
- 'v*.*.*'
pull_request:
types:
- labeled
jobs:
release:
permissions:
contents: write
pull-requests: write
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Bump version on merging Pull Requests with specific labels.
# (bump:major,bump:minor,bump:patch)
- id: bumpr
if: "!startsWith(github.ref, 'refs/tags/')"
uses: haya14busa/action-bumpr@v1
# Get tag name.
- id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}
# Setup Go for building reviewdog binary.
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
# Test goreleaser if the tag is empty.
- name: Test goreleaser
uses: goreleaser/goreleaser-action@v6
if: "steps.tag.outputs.value == ''"
with:
version: latest
args: check
# Create release.
- name: Create release with goreleaser
uses: goreleaser/goreleaser-action@v6
if: "steps.tag.outputs.value != ''"
with:
version: latest
args: release --clean --release-header .github/goreleaser-header.md
env:
# Need to use personal access token instead of default token to
# update https://github.com/reviewdog/homebrew-tap.
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Trigger depup workflows
if: "steps.tag.outputs.value != ''"
env:
# Need to use personal access token instead of default token to
# trigger workflow of other repositories.
DEPUP_GITHUB_API_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: go run ./scripts/trigger-depup/main.go
release-check:
permissions:
contents: write
pull-requests: write
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1