Bump github/codeql-action from 2.22.0 to 2.22.5 (#131) #293
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: Upload Python Package | |
on: | |
release: | |
types: [ created ] | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.0.0 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: '3.x' | |
check-latest: true | |
- name: Get Version | |
id: version | |
shell: bash | |
run: | | |
version="$(python3 ./.github/actions/get_version.py)" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
- name: Is Tag exists | |
uses: mukunku/tag-exists-action@v1.4.0 | |
id: checkTag | |
with: | |
tag: ${{ steps.version.outputs.version }} | |
- if: steps.checkTag.outputs.exists == 'false' | |
name: Check Tag | |
id: check-tag | |
run: | | |
if [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Build | |
if: steps.check-tag.outputs.match == 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
name: v${{ steps.version.outputs.version }} | |
draft: false | |
prerelease: false | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Checkout code for release | |
if: steps.check-tag.outputs.match == 'true' | |
uses: actions/checkout@v4.0.0 | |
- name: Set up Python | |
if: steps.check-tag.outputs.match == 'true' | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: "3.9" | |
check-latest: true | |
- name: Install dependencies | |
if: steps.check-tag.outputs.match == 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build and publish | |
if: steps.check-tag.outputs.match == 'true' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |