Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
Update release.yml according to pypi docs.

You can find the documentation [here](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/)

Change token for test pypi and change name to all upper case

Add workflow_dispatch to mannually trigger action

add on tags to action

change syntax for pushing tags
  • Loading branch information
ravinkohli committed Nov 23, 2021
1 parent e4863fe commit b091015
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,48 @@ name: Push to PyPi

on:
push:
branches:
- master
tags:
- "v*"
branches: [master]
workflow_dispatch:

jobs:
test:
build-n-publish:
runs-on: "ubuntu-latest"

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@master

- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Install build dependencies
run: python -m pip install build wheel
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Build distributions
shell: bash -l {0}
run: python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
if: github.repository == 'automl/Auto-PyTorch' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit b091015

Please sign in to comment.