Skip to content

Commit

Permalink
ci(python,rust): Use release-drafter to draft releases with changel…
Browse files Browse the repository at this point in the history
…ogs (#5033)
  • Loading branch information
stinodego authored Oct 1, 2022
1 parent 821fef2 commit bfea491
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 27 deletions.
4 changes: 0 additions & 4 deletions .github/labeler.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/release-drafter-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_extends: polars:.github/release-drafter.yml

name-template: Python Polars $RESOLVED_VERSION
tag-template: py-$RESOLVED_VERSION
tag-prefix: py-

include-labels:
- python
8 changes: 8 additions & 0 deletions .github/release-drafter-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_extends: polars:.github/release-drafter.yml

name-template: Rust Polars $RESOLVED_VERSION
tag-template: rs-$RESOLVED_VERSION
tag-prefix: rs-

include-labels:
- rust
83 changes: 83 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
categories:
- title: 🏆 Highlights
labels: highlight
- title: ⚠️ Breaking changes
labels: breaking
- title: 🚀 Performance improvements
labels: performance
- title: ✨ Enhancements
labels: enhancement
- title: 🐞 Bug fixes
labels: fix
- title: 🛠️ Other improvements
labels:
- build
- chore
- ci
- docs
- refactor
- revert
- style
- test

change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&'
replacers:
# Remove conventional commits from titles
- search: '/- (build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(\!)?\: /g'
replace: '- '

version-resolver:
minor:
labels: breaking
default: patch

autolabeler:
- label: rust
title:
- '/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)\(.*rust.*\)/'
- label: python
title:
- '/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)\(.*python.*\)/'
- label: breaking
title:
- '/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?\!\: /'
- label: build
title:
- '/^build/'
- label: chore
title:
- '/^chore/'
- label: ci
title:
- '/^ci/'
- label: docs
title:
- '/^docs/'
- label: enhancement
title:
- '/^feat/'
- label: fix
title:
- '/^fix/'
- label: performance
title:
- '/^perf/'
- label: refactor
title:
- '/^refactor/'
- label: revert
title:
- '/^revert/'
- label: style
title:
- '/^style/'
- label: test
title:
- '/^test/'

template: |
$CHANGES
Thank you to all our contributors for making this release possible!
$CONTRIBUTORS
2 changes: 1 addition & 1 deletion .github/workflows/create-py-mac-universal2-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create macOs universal2/aarch64-apple-darwin python release
on:
push:
tags:
- 'py-polars-v*'
- py-*

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-py-release-manylinux-lts-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create Python release manylinux LTS-CPU
on:
push:
tags:
- 'py-polars-v*'
- py-*

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-py-release-manylinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create Python release manylinux
on:
push:
tags:
- 'py-polars-v*'
- py-*

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-py-release-windows-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create Python release windows macos
on:
push:
tags:
- 'py-polars-v*'
- py-*

defaults:
run:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/labeler.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Pull request labeler

on:
pull_request_target:
types: [opened, edited]

permissions:
contents: read
pull-requests: write

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Label pull request
uses: release-drafter/release-drafter@v5
with:
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update draft releases

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: write
pull-requests: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Draft Rust release
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-rust.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Draft Python release
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-python.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@

changelog-python:
docker run -it --env-file .env --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u pola-rs -p polars --exclude-labels rust

changelog-rust:
docker run -it --env-file .env --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u pola-rs -p polars --exclude-labels python

fmt_toml:
dprint fmt

0 comments on commit bfea491

Please sign in to comment.