Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
ci: fix tag sent to git-cliff (#507)
Browse files Browse the repository at this point in the history
* Make a single release file

* ci: fix tag sent to git-cliff
  • Loading branch information
chamini2 committed Aug 8, 2022
1 parent f9fad8d commit 6e02c4f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 90 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/python-release-patch.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# This workflow will update the latest version with minor release and upload a package to PyPi

name: PyPI Release - minor
name: PyPI Release

on:
push:
branches: [release]
workflow_dispatch:
inputs:
version:
description: Version
required: false
default: patch
type: choice
options:
- patch
- minor

jobs:
deploy:
Expand All @@ -27,19 +38,30 @@ jobs:
PYPI_USERNAME: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry version minor
VERSION_TYPE="patch"
if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]
then
VERSION_TYPE="${{ github.event.inputs.version }}"
fi
poetry version $VERSION_TYPE
# version has format '0.4.1'
current_version=$(poetry version -s)
echo "current_version=$current_version" >> $GITHUB_ENV
# tag has format 'v0.4.0' (note the 'v')
prev_version_tag=$(git describe --tags --abbrev=0)
echo "prev_version_tag=$prev_version_tag" >> $GITHUB_ENV
echo "current_version=$current_version" >> $GITHUB_ENV
poetry build
- name: Generate a changelog
uses: orhun/git-cliff-action@v1
id: git-cliff
with:
config: cliff.toml
args: v${{ env.prev_version_tag }}..HEAD
args: ${{ env.prev_version_tag }}..HEAD
env:
OUTPUT: CHANGES.md

Expand Down

0 comments on commit 6e02c4f

Please sign in to comment.