Skip to content

Commit

Permalink
Add release workflow (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
levonet authored Nov 11, 2021
1 parent 6f7c577 commit a685e8b
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: release

on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
types:
- labeled

jobs:
release:
if: ${{ github.event.action != 'labeled' }}
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Bump version on merging Pull Requests with specific labels
id: bumpr
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: haya14busa/action-bumpr@v1

- name: Update corresponding major and minor tag
uses: haya14busa/action-update-semver@v1
if: ${{ !steps.bumpr.outputs.skip }}
with:
tag: ${{ steps.bumpr.outputs.next_version }}

- name: 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 }}

- name: Create release
uses: actions/create-release@v1
if: ${{ steps.tag.outputs.value != '' }}
env:
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

0 comments on commit a685e8b

Please sign in to comment.