Skip to content

Commit

Permalink
OPS: Add automatic release workflow
Browse files Browse the repository at this point in the history
skip_ci_tests
  • Loading branch information
cortadocodes committed Apr 21, 2021
1 parent 7c5c72a commit 11b01f6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish on merge of release/x.y.z into main

# Only trigger when a pull request into main branch is closed.
on:
pull_request:
types: [closed]
branches:
- main

jobs:
release:
# This job will only run if the PR has been merged (and not closed without merging).
if: github.event.pull_request.merged == true && startsWith( github.head_ref, 'release/' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get package version
run: echo "PACKAGE_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own.
with:
tag_name: ${{ env.PACKAGE_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: false
prerelease: false

0 comments on commit 11b01f6

Please sign in to comment.