Skip to content

fix(actions): Update glob patterns to match correct branch tags. #7

fix(actions): Update glob patterns to match correct branch tags.

fix(actions): Update glob patterns to match correct branch tags. #7

# Runs a build test every time a commit is pushed to branch 'main'.
name: Test and Publish Pre-Release Version of Python Package
on:
push:
tags:
- 'pre*'
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#pre}/g" setup.cfg
sed -i "s/__version__/${PKG_VERSION#pre}/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 }}