Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #58 from staticdev/release-workflow
Browse files Browse the repository at this point in the history
Release workflow
  • Loading branch information
Thiago C. D'Ávila authored May 28, 2020
2 parents 87f2028 + 563bf7f commit 23660f4
Showing 1 changed file with 41 additions and 11 deletions.
52 changes: 41 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Release

on:
release:
types: [published]
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/[email protected]
uses: actions/[email protected]
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -26,17 +30,43 @@ jobs:
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pip install --constraint=.github/workflows/constraints.txt nox
nox --version
- name: Detect and tag new version
id: check-version
uses: salsify/[email protected]
with:
version-command: |
poetry version | awk '{ print $2 }'
- name: Run Nox
run: nox --force-color
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
- run: poetry build --ansi
- name: Build package
run: |
poetry build --ansi
- uses: pypa/[email protected]
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 23660f4

Please sign in to comment.