Add merging tools #29
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: Version and Deploy | |
on: | |
push: | |
paths: | |
- 'fmtr/tools/version' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.event.inputs.version }} | |
NAME: ${{ github.event.repository.name }} | |
ORG: ${{ github.repository_owner }} | |
NAME_SHORT: tools | |
PATH_VERSION: ${{ github.repository_owner }}/tools/version | |
#SHLINK_API_KEY: ${{ secrets.SHLINK_API_KEY }} | |
#LINK_ID: tools | |
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 | |
- 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 | |
- name: Build Wheel | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Push Wheel | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
TWINE_USERNAME: __token__ | |
run: | | |
twine upload dist/* |