Skip to content

Bump peter-evans/create-pull-request from 6.1.0 to 7.0.6 (#210) #355

Bump peter-evans/create-pull-request from 6.1.0 to 7.0.6 (#210)

Bump peter-evans/create-pull-request from 6.1.0 to 7.0.6 (#210) #355

Workflow file for this run

name: Upload Python Package
on:
release:
types: [created]
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
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@bdad1eaa119ce71b150b952c97351c75025c06a9 # v1.6.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@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
if: steps.check-tag.outputs.match == 'true'
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
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/*