From 50611314cbd1c8971c4163b43a6a7b300a483a9f Mon Sep 17 00:00:00 2001 From: staticdev Date: Thu, 11 Jun 2020 17:59:31 -0300 Subject: [PATCH 1/2] Delete release-drafter workflow --- .github/workflows/release-drafter.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 20aded0..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - master - -jobs: - draft_release: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v5.8.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bc33dde942dbdb0f983e6a9f5b1960518c09a50b Mon Sep 17 00:00:00 2001 From: staticdev Date: Thu, 11 Jun 2020 17:59:44 -0300 Subject: [PATCH 2/2] Add release workflow --- .github/workflows/constraints.txt | 4 +++ .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/constraints.txt create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt new file mode 100644 index 0000000..fd929c7 --- /dev/null +++ b/.github/workflows/constraints.txt @@ -0,0 +1,4 @@ +pip==20.1.1 +nox==2020.5.24 +poetry==1.0.9 +pre-commit==2.5.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..44ee842 --- /dev/null +++ b/.github/workflows/release.yml @@ -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/checkout@v2.1.1 + 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/action-detect-and-tag-new-version@v1.0.3 + 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/release-drafter@v5.11.0 + with: + publish: ${{ steps.check-version.outputs.tag != '' }} + tag: ${{ steps.check-version.outputs.tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}