GitXplorerGitXplorer
b

release-often

public
8 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
f28034d5525faf1953927d321d162e42943361f6

Bump mypy from 0.780 to 0.781 (#50)

ddependabot-preview[bot] committed 5 years ago
Verified
7af9393671f8563da7fde7d2642ae6876932b04c

Bump trio from 0.15.1 to 0.16.0 (#49)

ddependabot-preview[bot] committed 5 years ago
Verified
71b6b01cfc2c7ed2561913f9c0a472cc5d4f787b

Bump flake8 from 3.8.2 to 3.8.3 (#48)

ddependabot-preview[bot] committed 5 years ago
Verified
dc273487237e79513cdc861b511dcce11f410400

Bump gidgethub from 4.1.0 to 4.1.1 (#47)

ddependabot-preview[bot] committed 5 years ago
Verified
d514bc700c28f8d639f6995a9a6fe44130b9299e

Bump pytest from 5.4.2 to 5.4.3 (#46)

ddependabot-preview[bot] committed 5 years ago
Verified
82ed3da5421f8d26d37dab6f723b1ecd7874a80f

Bump mypy from 0.770 to 0.780 (#45)

ddependabot-preview[bot] committed 5 years ago

README

The README file for this repository.

release-often

A GitHub Action for releasing a Python project to PyPI after every relevant, merged PR.

The purpose of this action is to make project maintenance as easy as possible for PyPI-hosted projects by removing the need to decide when to release. By releasing after every relevant PR is merged, not only is the question of whether to release gone, but the overhead of remembering how to even do a release and then preparing one is also gone. It also allows for releases to occur in situations where you may not have easy access to a checkout or machine set up to make a release (e.g. merging a PR from your phone). As well, contributors will be able to benefit from their hard work much faster than having to wait for the gathering of multiple changes together into a single release.

Do note that this action is not designed to work for all projects. This action is very opinionated and is not expected to be a fit for all Python projects.

Outline

  1. Update the version number according to a label on the merged PR
  2. Update the changelog based on the commit message
  3. Commit the above updates
  4. Build the sdist and wheel
  5. Upload to PyPI
  6. Create a release on GitHub

Caveats

Due to the fact that this action commits back to the repository, you cannot have srequired status checks on PRs as that prevents direct commits from non-admins.

Action instructions

Configuration example

name: Release

on:
  push:
    branches:
      - master

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-python@v2
      with:
        python-version: '3.8'

    # ... more steps for testing.

  lint:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-python@v2
      with:
        python-version: '3.8'

    # ... more steps for linting.

  release:
    needs: [test, lint]

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - uses: brettcannon/release-often@v1
      with:
        changelog-path: doc/CHANGELOG.rst  # XXX Update as appropriate!
        pypi-token: ${{ secrets.PYPI_TOKEN }}
        github-token: ${{ secrets.GITHUB_TOKEN }}

Inputs

changelog-path

Required: The path to the changelog file. Paths must end in one of the following extensions to denote the file format:

  • .md
  • .rst

Leaving this input out will disable automatic changelog updating.

The changelog file is expected to either be empty or have the appropriate header.

pypi-token

The PyPI API token for this project. It is strongly suggested that you create a token scoped to just this project.

Leaving this input out will disable uploading to PyPI.

github-token

Required: The GitHub access token (i.e. ${{ secrets.GITHUB_TOKEN }}). This allows for committing changes back to the repository.

Details

Update version

Based on which of the following labels are applied to a PR, update the version number:

  • impact-breaking to bump the major version
  • impact-feature to bump the minor version
  • impact-bugfix to bump the micro version
  • impact-post-release to add/bump the post version
  • impact-project to make no change

Supported build tools:

Update the changelog

The first line of the commit message is used as the entry in the changelog for the change. The PR and the author of the change are mentioned as part of the changelog entry.

Input:

  • Path to changelog file

Supported changelog formats are:

  • .md
  • .rst

Build sdist and wheel

Build the project's sdist and wheel using PEP 517.

Commit the changes

Once the above changes are made and the build artifacts can be successfully built, commit the changes that were made.

Upload to PyPI

With the checkout and repository in the appropriate state for release, the code can now be built and pushed to PyPI.

Input:

  • PyPI API token

Create a release on GitHub

Finally, when everything is live, create a release on GitHub to both tag the release in the repository and store the artifacts uploaded to PyPI. The name of the release is the version prepended by v and the body of the release is the changelog entry.