Skip to content

Commit

Permalink
Auto releases with auto
Browse files Browse the repository at this point in the history
Fixes: #7
  • Loading branch information
asmacdo committed May 7, 2024
1 parent 22acf20 commit b55c5f1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Auto-release on PR merge

on:
# ATM, this is the closest trigger to a PR merging
push:
branches:
- master

jobs:
auto-release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download auto
run: |
#curl -vL -o - "$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" | gunzip > ~/auto
# Initially pin to 10.16.1 so we don't break if & when
# <https://github.com/intuit/auto/issues/1778> is fixed.
# Needed to progress to 11.1.6 (current release) to have
# a fix for https://github.com/intuit/auto/issues/2432,
# while 1778 was still open/left without comment.
wget -O- https://github.com/intuit/auto/releases/download/v11.1.6/auto-linux.gz | gunzip > ~/auto
chmod a+x ~/auto
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '^3.8'

# - name: Install Python dependencies
# run: python -m pip install build bump2version twine

- name: Create release
run: ~/auto shipit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

# vim:set sts=2:
21 changes: 21 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Releases and Changelog
----------------------

We use the `auto <https://intuit.github.io/auto/>`_ tool to generate the changelog and automatically release the project.

`auto` is used in by GitHub actions, which monitors the labels on the pull request.
This automation can add entries to the changelog, cut releases, and
push new images to `dockerhub <https://hub.docker.com/r/centerforopenneuroscience/duct>`_.

The following pull request labels are respected:

* major: Increment the major version when merged
* minot: Increment the minot version when merged
* patch: Increment the patch version when merged
* skip-release: Preserve the current version when merged
* release: Create a release when this pr is merged
* internal: Changes only affect the internal API
* documentation: Changes only affect the documentation
* tests: Add or improve existing tests
* dependencies: Update one or more dependencies version
* performance: Improve performance of an existing feature

0 comments on commit b55c5f1

Please sign in to comment.