Skip to content

Commit c89bece

Browse files
committed
added changelog and workflows
1 parent d617209 commit c89bece

4 files changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: prepare release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
description: Semantic version component to bump
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
release-pr:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: compas-dev/compas-actions/release-pr@main
24+
with:
25+
release-type: ${{ inputs.release-type }}
26+
github-token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release:
13+
name: Detect release merge
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is-release: ${{ steps.release.outputs.is-release }}
17+
version: ${{ steps.release.outputs.version }}
18+
tag: ${{ steps.release.outputs.tag }}
19+
steps:
20+
- uses: compas-dev/compas-actions/release-check@main
21+
id: release
22+
23+
prepare:
24+
needs: release
25+
if: needs.release.outputs.is-release == 'true'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: compas-dev/compas-actions/prepare-release@main
29+
with:
30+
python-version: "3.12"
31+
management-tool: uv
32+
33+
publish:
34+
needs: [release, prepare]
35+
if: needs.release.outputs.is-release == 'true'
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/ghpython_componentizer
40+
permissions:
41+
contents: read
42+
id-token: write
43+
steps:
44+
- name: Download package distributions
45+
uses: actions/download-artifact@v8.0.1
46+
with:
47+
name: python-package-distributions
48+
path: dist
49+
50+
- name: Publish package distributions to PyPI
51+
uses: pypa/gh-action-pypi-publish@v1.14.2
52+
53+
create-release:
54+
needs: [release, publish]
55+
if: needs.release.outputs.is-release == 'true'
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: compas-dev/compas-actions/github-release@main
61+
with:
62+
github-token: ${{ github.token }}
63+
tag-name: ${{ needs.release.outputs.tag }}
64+
target: ${{ github.sha }}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## Unreleased
9+
10+
### Added
11+
12+
* Added `build_components` and `create_ghuser_component`, to build `.ghuser` components out of source bundles from Python.
13+
* Added the `ghpython-componentizer` command line, also runnable as `python -m ghpython_componentizer`.
14+
* Added support for macOS: the command line relaunches itself with the environment Mono needs to find `libgdiplus`.
15+
* Added `componentizer_env` and `run_componentizer`, to build components from a process that is already running.
16+
17+
### Changed
18+
19+
### Removed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,21 @@ The test suite covers the parts that do not require a .NET runtime, so it runs o
243243
Linting and formatting follow the same [ruff](https://docs.astral.sh/ruff/) rules as the other
244244
COMPAS packages, configured in `pyproject.toml`.
245245

246+
## Releasing
247+
248+
Releases are prepared and published by pull request, with the shared
249+
[compas-actions](https://github.com/compas-dev/compas-actions).
250+
251+
1. Describe the changes under `## Unreleased` in [CHANGELOG.md](CHANGELOG.md), as they are merged.
252+
1. Run the *prepare release* workflow from the Actions tab, choosing `patch`, `minor` or `major`.
253+
It bumps the version, closes the changelog section and opens a `release/vX.Y.Z` pull request.
254+
1. Review and merge that pull request.
255+
256+
Merging it runs the *release* workflow: it builds the distributions, publishes them to PyPI through
257+
[trusted publishing](https://docs.pypi.org/trusted-publishers/) and creates the tagged GitHub
258+
release, with the changelog section as release notes. No API token is involved: PyPI needs a
259+
publisher configured for this repository, the `release.yml` workflow and the `pypi` environment.
260+
246261
## License
247262

248263
This package is maintained by Gramazio Kohler Research [@gramaziokohler](https://github.com/gramaziokohler)

0 commit comments

Comments
 (0)