Skip to content

Commit

Permalink
Release workflow update (acts-project#318)
Browse files Browse the repository at this point in the history
- Remove a bunch of old stuff and scripts we don't need anymore
- New updated release helper script in `CI/release.py`
  - Can make a release branch, bump version and push, both for fix and minor releases.
  - Can make release notes from milestone and tag name (I've been using this for the releases so far on Github)
- Workflow file with a manual trigger to run exactly this. Once this is merged into master, we can manually trigger this workflow with a desired tag name. The script will figure out what to do (either create a new release branch, bump and tag there, or use existing release branch), make a release, create release notes and close the milestone.

I tried to make it assert as much as possible to prevent any data corruption, but the entire process is not a transaction. If for whatever reason it fails midway, manual cleanup is required. Anyway I think this might help automate this more. I tested this on my fork, and in the tests it seemed to work fine.

I think anyone with write access will be able to trigger the workflow, and thus make a new release.

Co-authored-by: robertlangenberg <[email protected]>
  • Loading branch information
paulgessinger and robertlangenberg authored Jul 20, 2020
1 parent 8c1280e commit d6c7ac9
Show file tree
Hide file tree
Showing 17 changed files with 772 additions and 1,488 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to create'
required: true

jobs:
release:
runs-on: ubuntu-latest
container: python:3.8-alpine
steps:
- name: Git setup
run: |
apk add git
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- uses: actions/checkout@v2
with:
path: "clone"
- name: Setup
run: |
cp -r clone/CI .
pip install -r CI/requirements.txt
- name: Make release
run: |
export TAG_NAME=${{ github.event.inputs.tag }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
cd clone
../CI/release.py tag $TAG_NAME --yes
../CI/release.py notes $TAG_NAME --yes
11 changes: 11 additions & 0 deletions CI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CI instructions

This directory comntains scripts and other files relating to the CI.

## Use poetry to manage requirements

Since [`poetry`](https://python-poetry.org) supports more robust dependency locking than `pip` this is used for dependency tracking. The authoritative files are `pyproject.toml` which defines the primary dependencies, and `poetry.lock` which defines the full locked dependencies. This can be exported to a `requirements.txt` file via

```console
poetry export -f requirements.txt > requirements.txt
```
24 changes: 0 additions & 24 deletions CI/coverage_environment.sh

This file was deleted.

173 changes: 0 additions & 173 deletions CI/deploy_tag.py

This file was deleted.

26 changes: 0 additions & 26 deletions CI/gitlab_helpers.py

This file was deleted.

48 changes: 0 additions & 48 deletions CI/incremental_prev_tag.py

This file was deleted.

Loading

0 comments on commit d6c7ac9

Please sign in to comment.