Skip to content

Commit

Permalink
MRG: Merge pull request #2 from octue/devops/improve-workflows-and-ad…
Browse files Browse the repository at this point in the history
…d-badges-to-readme

Make release workflow more efficient; add badges to README
  • Loading branch information
cortadocodes authored Oct 4, 2022
2 parents b55e022 + b1b1ab4 commit 8a1a3c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release the package on merge into main
name: Release

# Only trigger when a pull request into main branch is closed.
on:
Expand All @@ -25,6 +25,9 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Get package version
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_ENV

- name: Install tox
run: pip install tox

Expand All @@ -38,42 +41,33 @@ jobs:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

outputs:
package_version: ${{ env.PACKAGE_VERSION }}

release:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Get package version
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_ENV

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own.
with:
tag_name: ${{ env.PACKAGE_VERSION }}
tag_name: ${{ needs.tests.outputs.package_version }}
release_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: false
prerelease: false

docker:
runs-on: ubuntu-latest
needs: release
needs: [tests, release]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Get package version
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_ENV

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
Expand All @@ -85,4 +79,4 @@ jobs:
with:
context: .
push: true
tags: octue/generate-pull-request-description:${{ env.PACKAGE_VERSION }},octue/generate-pull-request-description:latest
tags: octue/generate-pull-request-description:${{ needs.tests.outputs.package_version }},octue/generate-pull-request-description:latest
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[![Release](https://github.com/octue/generate-pull-request-description/actions/workflows/release.yml/badge.svg)](https://github.com/octue/generate-pull-request-description/actions/workflows/release.yml)
[![codecov](https://codecov.io/gh/octue/generate-pull-request-description/branch/main/graph/badge.svg?token=J3NFSPZJHW)](https://codecov.io/gh/octue/generate-pull-request-description)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

# Pull request description generator
A GitHub action and command-line tool that generates pull request descriptions from Conventional Commit messages on a
branch. These descriptions can be used with other GitHub actions to automate release notes.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "generate-pull-request-description"
version = "1.0.0.beta-0"
version = "1.0.0.beta-1"
description = "A GitHub action that summarises the commits in a pull request for its description."
authors = ["Marcus Lugg <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 8a1a3c1

Please sign in to comment.