boosted version for publishing #4
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
name: Release package | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*.*.*" | |
jobs: | |
package-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Check tag syntax and set environmental variable | |
id: check-tag | |
run: | | |
if [[ ${{ github.ref }} =~ ^refs/tags/t[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "Tag syntax is for testing" | |
echo "::set-output name=test_tag::true" | |
else | |
echo "Tag syntax is for release" | |
echo "::set-output name=test_tag::false" | |
fi | |
- name: Build and publish to pypi | |
uses: JRubics/[email protected] | |
with: | |
pypi_token: ${{ secrets.PYPI_TOKEN }} | |
env: | |
repository_name: ${{ steps.check-tag.outputs.test_tag == 'true' && 'testpypi' || '' }} | |
repository_url: ${{ steps.check-tag.outputs.test_tag == 'true' && 'https://test.pypi.org/legacy/' || '' }} |