Skip to content

Commit

Permalink
ci: move gh release to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
Calychas committed Nov 22, 2023
1 parent b9d2600 commit aa40067
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,6 @@ jobs:
name: "Run tests job"
uses: ./.github/workflows/_tests.yml

github-release:
if: ${{ contains(github.event.head_commit.message, format('chore(CI/CD){0} bump version', ':')) }}
name: Create a GitHub release
needs: [run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CICD_PAT_TOKEN }}
- name: Configure Git user
run: |
git config --local user.name "Kraina CI/CD"
git config --local user.email "[email protected]"
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Extract version
id: extract-version
uses: winterjung/split@v2
with:
msg: ${{ github.event.head_commit.message }}
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CICD_PAT_TOKEN }}
tag_name: ${{ steps.extract-version.outputs._5 }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}

build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
needs: [run-tests]
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "GitHub release"
on:
push:
branches:
- main

jobs:
run-tests:
name: "Run tests job"
uses: ./.github/workflows/_tests.yml

github-release:
if: ${{ contains(github.event.head_commit.message, format('chore(CI/CD){0} bump version', ':')) }}
name: Create a GitHub release
needs: [run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CICD_PAT_TOKEN }}
- name: Configure Git user
run: |
git config --local user.name "Kraina CI/CD"
git config --local user.email "[email protected]"
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Extract version
id: extract-version
uses: winterjung/split@v2
with:
msg: ${{ github.event.head_commit.message }}
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CICD_PAT_TOKEN }}
tag_name: ${{ steps.extract-version.outputs._5 }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}

0 comments on commit aa40067

Please sign in to comment.