Skip to content

Commit

Permalink
Merge pull request #6 from shogo82148/add-release-workflow
Browse files Browse the repository at this point in the history
add the release workflow
  • Loading branch information
shogo82148 authored Jul 12, 2021
2 parents b207de1 + 559f0f3 commit 9d24e3a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: release
on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
types:
- labeled

jobs:
release:
if: ${{ github.event.action != 'labeled' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# 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

# Update corresponding major and minor tag.
# e.g. Update v1 and v1.2 when releasing v1.2.3
- uses: haya14busa/action-update-semver@v1
if: "${{ !steps.bumpr.outputs.skip }}"
with:
tag: ${{ steps.bumpr.outputs.next_version }}

# 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 }}

# Create release.
- uses: actions/create-release@v1
if: "${{ steps.tag.outputs.value != '' }}"
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.value }}
release_name: Release ${{ steps.tag.outputs.value }}
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false

release-check:
if: "${{ github.event.action == 'labeled' }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
12 changes: 11 additions & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ jobs:
- name: actionlint
uses: ./
with:
actionlint_flags: examples/broken-workflow.yml
tool_name: actionlint

reviewdog:
name: runner / reviewdog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: actionlint w/ reviewdog
uses: ./
with:
actionlint_flags: examples/broken-workflow.yml
tool_name: reviewdog

shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9d24e3a

Please sign in to comment.