Skip to content

Release/v1.3.5

Release/v1.3.5 #5

name: Release Automation
on:
pull_request:
types: [closed]
jobs:
create_release:
# We only run it for merged PRs from a release/* branch into master.
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'master' &&
startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
permissions:
contents: write # to create tags and releases
pull-requests: write # to create PR
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# We check out the master branch, which is the state after the merge.
ref: 'master'
fetch-depth: 0
- name: Get Version
id: get_version
run: |
# Извлекаем версию из pyproject.toml
version=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Extract Changelog Notes
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.get_version.outputs.version }}
path: ./CHANGELOG.md
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: false
- name: Create back-merge PR to dev
uses: repo-sync/pull-request@v2
with:
source_branch: "master"
destination_branch: "dev"
pr_title: "Post-Release: Merge master back into dev"
pr_body: "Automated PR to sync master back into dev after release v${{ steps.get_version.outputs.version }}."
github_token: ${{ secrets.GITHUB_TOKEN }}