Skip to content

Commit c61d3b0

Browse files
committed
Update docs
1 parent 60d0a4f commit c61d3b0

3 files changed

Lines changed: 61 additions & 95 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

docs/samples/release.container.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This sample workflow demonstrates a complete release pipeline that combines semantic versioning, container publishing, and automated tagging. It's designed to be copied into your project's `.github/workflows/` directory and customised for your specific needs.
44

5+
The idea is to provide a drop-in model for releasing software, where developers can focus on code, rather than the mechanics of releases. The developer only has to make the decision of what type of release (patch, minor, major, none) and communicate this through their PR title. The workflow then takes care of the rest - generating release notes, creating GitHub releases, building and publishing container images, and tagging them appropriately.
6+
7+
This exists within the existing constraints of Github, mostly that [automated releases cannot trigger other workflows](https://github.com/orgs/community/discussions/25281), so by composing reusable workflows together we can achieve a full release pipeline that is still easy to understand and maintain. The workflow is also designed to be flexible, so you can easily swap out the container publishing step for other types of release artifacts if needed.
8+
59
## Overview
610

711
The workflow performs the following steps:
@@ -37,6 +41,7 @@ Uses the [`publish-container.yml`](../publish-container.md) reusable workflow to
3741
- Push to the specified container registry
3842

3943
**Parameters:**
44+
4045
- `image-name`: Name of your container image
4146
- `image-description`: Description for the image
4247
- `registry`: Container registry (e.g., `ghcr.io`, `docker.io`)
@@ -52,6 +57,7 @@ Uses the [`semver-container.yml`](../semver-container.md) reusable workflow to:
5257
- Only runs if `semantic-release` created a new release
5358

5459
**Parameters:**
60+
5561
- `image-name`: Must match the `publish-container` job
5662
- `registry`: Must match the `publish-container` job
5763
- `tag`: Release tag from semantic-release (do not modify)
@@ -67,7 +73,7 @@ uses: health-informatics-uon/workflows/.github/workflows/semantic-release.yml@v1
6773
Check the [releases](https://github.com/health-informatics-uon/workflows/releases) for available versions.
6874
6975
## Usage
70-
76+
7177
1. Copy `samples/release.container.yaml` to your repository's `.github/workflows/release.yaml`
7278
2. Copy `samples/release.config.js` to your repository root and customise it for your repository
7379
3. Update the workflow parameters in `release.yaml` (image name, etc.)

samples/publish.pypi.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
name: Build distribution
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: "3.x"
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
- name: Build package
29+
run: python -m build
30+
- name: Store the distribution packages
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: python-package-distributions
34+
path: dist/
35+
36+
publish-to-pypi:
37+
name: Publish Python distribution to PyPI
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/omop-lite
44+
permissions:
45+
id-token: write
46+
47+
steps:
48+
- name: Download all the dists
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
- name: Publish distribution 📦 to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)