Update .jira_sync_config.yaml #18
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: Push to Main | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
jobs: | |
version-check: | |
runs-on: ubuntu-latest | |
outputs: | |
new_version: ${{ steps.check-version.outputs.new_version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check Version | |
id: check-version | |
run: | | |
version=$(grep -P -o 'version = "\d+\.\d+\.\d+"' pyproject.toml | grep -P -o '\d+\.\d+\.\d+') | |
tags=$(git tag -l '*.*.*') | |
match=$(echo ${tags} | grep -w -c ${version} | cat) | |
if [ "${match}" == "0" ]; then | |
echo "new_version=${version}" >> "${GITHUB_OUTPUT}" | |
else | |
echo "new_version=false" >> "${GITHUB_OUTPUT}" | |
fi | |
python-package: | |
runs-on: ubuntu-latest | |
needs: version-check | |
if: ${{ needs.version-check.outputs.new_version != 'false' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Install Build Tools | |
run: pip install --upgrade build twine | |
- name: Build | |
run: python3 -m build | |
- name: Upload | |
run: | | |
python3 -m twine upload \ | |
--verbose --non-interactive \ | |
--username __token__ --password ${{ secrets.PYPI_TOKEN }} \ | |
dist/* | |
- name: Tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: "${{ secrets.GITHUB_TOKEN }}" | |
custom_tag: "${{ needs.version-check.outputs.new_version }}" | |
tag_prefix: "" | |
default_bump: false |