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

Commit

Permalink
Merge pull request #21 from staticdev/release-workflow
Browse files Browse the repository at this point in the history
Release workflow
  • Loading branch information
Thiago C. D'Ávila committed Jun 11, 2020
2 parents 1383345 + bc33dde commit 42283e1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip==20.1.1
nox==2020.5.24
poetry==1.0.9
pre-commit==2.5.1
14 changes: 0 additions & 14 deletions .github/workflows/release-drafter.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
branches:
- master

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

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

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/[email protected]
with:
version-command: |
poetry version | awk '{ print $2 }'
- 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)
- 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 42283e1

Please sign in to comment.