Merge pull request #144 from reviewdog/depup/actionlint #163
This file contains 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: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
release: | |
if: ${{ github.event.action != 'labeled' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Release tags must be reachable from HEAD because the bump comment uses `git tag --merged`: | |
# https://github.com/haya14busa/bump/blob/9ab5412f5d96eb624c7e8559acbb11330be9901a/main.go#L72 | |
- name: checkout to release branch | |
run: | | |
git checkout -b "releases/$(cat .major-version)" "origin/releases/$(cat .major-version)" | |
# Bump version on merging Pull Requests with specific labels. | |
# (bump:major,bump:minor,bump:patch) | |
- id: bumpr | |
uses: haya14busa/action-bumpr@v1 | |
with: | |
dry_run: true | |
# build the Docker Image | |
- name: build the Docker Image | |
if: "${{ !steps.bumpr.outputs.skip }}" | |
run: | | |
git checkout main | |
./.github/build.sh | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
INPUT_TAG: ${{ steps.bumpr.outputs.next_version }} | |
# Create release. | |
- uses: shogo82148/actions-create-release@v1 | |
if: "${{ !steps.bumpr.outputs.skip }}" | |
with: | |
tag_name: ${{ steps.bumpr.outputs.next_version }} | |
release_name: Release ${{ steps.bumpr.outputs.next_version }} | |
body: ${{ steps.bumpr.outputs.message }} | |
draft: false | |
prerelease: false | |
release-check: | |
if: "${{ github.event.action == 'labeled' }}" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
issues: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Release tags must be reachable from HEAD because the bump comment uses `git tag --merged`: | |
# https://github.com/haya14busa/bump/blob/9ab5412f5d96eb624c7e8559acbb11330be9901a/main.go#L72 | |
- name: checkout to release branch | |
run: | | |
git checkout -b "releases/$(cat .major-version)" "origin/releases/$(cat .major-version)" | |
- name: Post bumpr status comment | |
uses: haya14busa/action-bumpr@v1 |