Skip to content

Commit

Permalink
✨feat: seperate test and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
zillionare committed Apr 17, 2021
1 parent c0eb5d6 commit 66c0489
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,3 @@ jobs:
password: ${{ secrets.TEST_PYPI_API_TOKEN}}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish to PyPI only on release branch when tagged
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Publish package on release branch if it's tagged with 'v*'

name: release & publish

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branch: release
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release:
name: Create Release
runs-on: ubuntu-18.04

strategy:
matrix:
python-versions: [3.8]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: create github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
draft: false
prerelease: false

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-versions }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox-gh-actions poetry
- name: pre-publish documentation
run: |
poetry install -E doc
poetry run mkdocs build
- name: publish documentation
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./site

- name: Build wheels and source tarball
run: >-
poetry build
- name:
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true

0 comments on commit 66c0489

Please sign in to comment.