Skip to content

Release Website Package #9

Release Website Package

Release Website Package #9

name: Release Website Package
on:
workflow_dispatch:
# push:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install poetry
poetry install
- name: Determine Bump Type
id: bump_type
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "bump_type=patch" >> $GITHUB_ENV
else
echo "bump_type=minor" >> $GITHUB_ENV
fi
- name: Get package version and changelog body
run: |
poetry run python bump_version.py ${{ env.bump_type }}
PACKAGE_VERSION=$(poetry version -s)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Build Package
run: poetry build
- name: Tag Release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag -a v${{ env.PACKAGE_VERSION }} -m "Release v${{ env.PACKAGE_VERSION }}"
git push origin v${{ env.PACKAGE_VERSION }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: v${{ env.PACKAGE_VERSION }}
artifacts: "dist/*.tar.gz"
bodyFile: CHANGELOG.md
token: ${{ secrets.GH_PAT }}