fix(actions): Remove 'v' from tag when setting the release version fo… #1
Workflow file for this run
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
# Runs a build test every time a commit is pushed to branch 'main'. | |
name: Test and Publish Python Package | |
on: | |
push: | |
tags: | |
- 'v*[ab]*' | |
- 'v*rc*' | |
jobs: | |
test-ddm: | |
uses: ./.github/workflows/test-ddm.yml | |
publish-docs: | |
needs: test-ddm | |
if: success() | |
uses: ./.github/workflows/publish-docs.yml | |
deploy: | |
needs: test-ddm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Extract version name | |
run: echo "PKG_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Update package version in files | |
run: | | |
sed -i "s/__version__/${PKG_VERSION#v}/g" setup.cfg | |
sed -i "s/__version__/${PKG_VERSION#v}/g" ddm/__init__.py | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |