mirror of
https://github.com/fmtr/haco.git
synced 2026-10-25 18:40:15 -04:00
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Version and Deploy
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'haco/version'
|
|
workflow_dispatch:
|
|
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
VERSION: ${{ github.event.inputs.version }}
|
|
NAME: ${{ github.event.repository.name }}
|
|
NAME_SHORT: ${{ github.event.repository.name }}
|
|
ORG: ${{ github.repository_owner }}
|
|
PATH_VERSION: haco/version
|
|
#SHLINK_API_KEY: ${{ secrets.SHLINK_API_KEY }}
|
|
#LINK_ID: haco/tapp
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set Version Environment Variable
|
|
run: |
|
|
VERSION=$(cat ${PATH_VERSION})
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Install Tools
|
|
run: |
|
|
pip install twine
|
|
pip install -U packaging setuptools twine pip build #https://github.com/pypa/twine/issues/1216
|
|
|
|
|
|
- name: Increment Version
|
|
env:
|
|
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
|
|
run: |
|
|
git config --global user.name 'Frontmatter Actions'
|
|
git config --global user.email "$GIT_EMAIL"
|
|
VERSION=${{ env.VERSION }}
|
|
git tag -a v${VERSION} -m "Release version ${VERSION}"
|
|
git checkout --track origin/release
|
|
git rebase main
|
|
git push --follow-tags
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: v${{ env.VERSION }}
|
|
generate_release_notes: true
|
|
#prerelease: true
|
|
|
|
- name: Build Wheel
|
|
run: |
|
|
python -m build
|
|
|
|
- name: Push Wheel
|
|
env:
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
TWINE_USERNAME: __token__
|
|
run: |
|
|
twine upload dist/*
|