Skip to content

sdfsdfsd

sdfsdfsd #22

Workflow file for this run

name: "Release"
on:
push:
tags:
- "v*.*.*" # Match tags that start with 'v'
workflow_dispatch:
inputs:
tag:
description: Tag for automatic release
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- name: Setting up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setting up the environment
run: pip install tomlkit
- name: Setting a branch
run: git checkout main && git checkout -b post_release_branch
- name: Get latest tag
id: var
run: |
if [ "${{ github.event_name }}" == "push" ]; then
latest_tag=$(git describe --tags --abbrev=0)
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
latest_tag="${{ github.event.inputs.tag }}"
fi
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
echo $latest_tag
shell: bash
- name: Updating version in pyproject.toml
run: |
python .github/scripts/update_pyproject_version.py --tag ${{ steps.var.outputs.latest_tag }}
- name: Commit changes
run: |
git add pyproject.toml
git commit -m"🚀 Updated files after release" || { echo "Nothing to commit. Exiting." && exit 0; }
git push --set-upstream origin post_release_branch --force
gh pr create -B main -H post_release_branch --title "🚀 Updated files after release" --body "Created by Github action"
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: merge PR
run: |
gh pr merge --admin --squash -t "🚀 Updated files after release"
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: Upload Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
tag: ${{ steps.var.outputs.latest_tag }}
token: ${{ secrets.TOKEN }}