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

chore: use path inclusion to separate project changelog #614

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
jobs:
deploy:
# Run only for `release` branch or if marked as acceptable
if: github.ref == 'refs/heads/release' || inputs.publish_from_any_branch
# if: github.ref == 'refs/heads/release' || inputs.publish_from_any_branch

runs-on: ubuntu-latest

Expand All @@ -52,13 +52,32 @@ jobs:
run: |
if [[ ${{ inputs.package }} == fal ]]
then
"PACKAGE_DIR=." >> $GITHUB_ENV
"TAG_PREFIX=v" >> $GITHUB_ENV
else if [[ ${{ inputs.package }} == dbt-fal ]]
"PACKAGE_DIR=adapter" >> $GITHUB_ENV
"TAG_PREFIX=adapter-v" >> $GITHUB_ENV
PACKAGE_DIR=.
TAG_PREFIX=v
elif [[ ${{ inputs.package }} == dbt-fal ]]
then
PACKAGE_DIR=adapter
TAG_PREFIX=adapter-v
fi

echo "PACKAGE_DIR=$PACKAGE_DIR" >> $GITHUB_ENV
echo "TAG_PREFIX=$TAG_PREFIX" >> $GITHUB_ENV


INCLUDE=""
for val in src integration_tests tests
do
INCLUDE="$INCLUDE $PACKAGE_DIR/$val/*"
done

INCLUDE=""
for val in poetry.lock pyproject.toml
do
INCLUDE="$INCLUDE $PACKAGE_DIR/$val"
done

echo "GIT_CLIFF_INCLUDE_PATH=$INCLUDE" >> $GITHUB_ENV

- name: Install poetry
shell: bash
run: pip install poetry-core=="1.0.*" poetry=="1.1.4"
Expand All @@ -78,19 +97,20 @@ jobs:
echo "current_version=$current_version" >> $GITHUB_ENV

# tag has format 'v0.4.0' (note the 'v')
prev_version_tag=$(git describe --tags --match '${{ env.TAG_PREFIX }}0.*' --abbrev=0)
prev_version_tag=$(git describe --tags --match '${{ env.TAG_PREFIX }}*' --abbrev=0)
echo "prev_version_tag=$prev_version_tag" >> $GITHUB_ENV

poetry build

- name: Generate a changelog
uses: orhun/git-cliff-action@v1
uses: chamini2/git-cliff-action@main
id: git-cliff
with:
config: ${{ env.PACKAGE_DIR }}/cliff.toml
args: ${{ env.prev_version_tag }}..${{ github.ref }}
config: cliff.toml
args: -v ${{ env.prev_version_tag }}..${{ github.ref }}
env:
OUTPUT: CHANGES.md
GIT_CLIFF_INCLUDE_PATH: ${{ env.GIT_CLIFF_INCLUDE_PATH }}

- name: Set the release body
id: release
Expand All @@ -100,9 +120,10 @@ jobs:
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "::set-output name=RELEASE_BODY::$r"
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT

- name: Publish GitHub
if: false
uses: softprops/action-gh-release@v1
with:
name: ${{ inputs.package }} ${{ env.current_version }}
Expand All @@ -113,23 +134,30 @@ jobs:
${{ env.PACKAGE_DIR }}/dist/${{ inputs.package }}-${{ env.current_version }}.tar.gz

- name: Publish PyPI
if: false
working-directory: ${{ env.PACKAGE_DIR }}
env:
PYPI_USERNAME: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD -v -n

- name: Bump repo version
if: false
working-directory: ${{ env.PACKAGE_DIR }}
run: |
git clean -fxd # Clear all the changes
poetry version ${{ env.current_version }}
poetry version ${{ inputs.next_version }}

- name: Create Pull Request
if: false
uses: peter-evans/create-pull-request@v4
with:
delete-branch: true
title: Bump the pyproject.toml version
base: main
token: ${{ secrets.RELEASER_GITHUB_PAT }}

- name: show the body
shell: bash
run: cat "${{ steps.git-cliff.outputs.changelog }}"
71 changes: 0 additions & 71 deletions adapter/cliff.toml

This file was deleted.

16 changes: 0 additions & 16 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,13 @@ commit_preprocessors = [
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^feat(fal)", group = "Features"},
{ message = "^feat(fal-cli)", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^fix(fal)", group = "Bug Fixes"},
{ message = "^fix(fal-cli)", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^doc(fal)", group = "Documentation"},
{ message = "^doc(fal-cli)", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^perf(fal)", group = "Performance"},
{ message = "^perf(fal-cli)", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^refactor(fal)", group = "Refactor"},
{ message = "^refactor(fal-cli)", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^style(fal)", group = "Styling"},
{ message = "^style(fal-cli)", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^test(fal)", group = "Testing"},
{ message = "^test(fal-cli)", group = "Testing"},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ message = "^chore(fal)", group = "Miscellaneous Tasks"},
{ message = "^chore(fal-cli)", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
]
# filter out the commits that are not matched by commit parsers
Expand Down