Release Website Package #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]" | |
# 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 }} | |