Merge pull request #23 from Standard-Query-Language/dependabot/github… #21
Workflow file for this run
This file contains hidden or 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: Release on Tags | |
| on: | |
| push: | |
| tags: | |
| - '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools wheel twine | |
| - name: Extract tag name | |
| id: tag | |
| run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Update version in setup.py | |
| run: | | |
| # Remove 'v' prefix if present | |
| VERSION="${{ steps.tag.outputs.TAG_NAME }}" | |
| VERSION=${VERSION#v} | |
| sed -i "s/version=['\"][^'\"]*['\"]/version='$VERSION'/g" setup.py | |
| - name: Build and package | |
| run: | | |
| python setup.py sdist bdist_wheel | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Release ${{ steps.tag.outputs.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| dist/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }} |