Skip to content

Commit

Permalink
OPS: Fix automated releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Nov 16, 2023
1 parent 099ad7b commit 7460632
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,23 +263,3 @@ jobs:
# run: |
# echo "${{ steps.deploy_worker.outputs.url }}"
# echo "${{ steps.deploy_api.outputs.url }}"

release:
# This job will only run if the PR has been merged (and not closed without merging).
if: "github.event.pull_request.merged == true"
runs-on: ubuntu-latest
needs: [info, deploy]
steps:
- name: Checkout code
uses: actions/checkout@v2

- 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: ${{ needs.info.outputs.version }}
release_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: false
prerelease: false
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

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

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Poetry
uses: snok/[email protected]

- name: Check pyproject.toml file
run: poetry check

- name: Get package version
id: get-package-version
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT

- 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: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: false
prerelease: false

0 comments on commit 7460632

Please sign in to comment.