Skip to content

Release Website Package #19

Release Website Package

Release Website Package #19

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 -e ".[dev]"
pip install build
# TODO: Add a better way to determine type of version change
- 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: Launch bump version script
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
python release.py ${{ env.bump_type }}
PACKAGE_VERSION=$(sed -n 's/^version *= *"\(.*\)"/\1/p' pyproject.toml)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Build Package
run: python -m build
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: v${{ env.PACKAGE_VERSION }}
artifacts: "dist/*.tar.gz"
bodyFile: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}