Skip to content

Commit 9f3591b

Browse files
committed
Initial commit
0 parents  commit 9f3591b

14 files changed

Lines changed: 1916 additions & 0 deletions

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
max_line_length = 100
12+
13+
[Makefile]
14+
indent_style = tab
15+
16+
[{*.json,*.yml,*.yaml}]
17+
indent_style = space
18+
indent_size = 2

.github/scripts/extract-notes.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Usage: .github/scripts/extract-notes.sh OWNER/SLUG GITREF
3+
4+
IFS='/'; read -ra REPOSITORY <<<"${1}"
5+
OWNER=${REPOSITORY[0]}
6+
SLUG=${REPOSITORY[1]}
7+
GITREF=${2}
8+
9+
if [[ "${GITREF}" == refs/tags/* ]]; then
10+
TAG="${GITREF#refs/tags/}"
11+
VERSION="${TAG#v}"
12+
MACRO_MESO=$(echo "${VERSION}" | cut -d. -f1,2)
13+
else
14+
TAG="unreleased"
15+
VERSION="Unreleased"
16+
MACRO_MESO="dev"
17+
fi
18+
19+
# Extract the release notes from the changelog
20+
sed -n "/## \[${VERSION}\]/, /## /{ /##/!p }" CHANGELOG.md > notes.md
21+
22+
# Add a link to the release notes
23+
URL="https://${OWNER}.github.io/${SLUG}/${MACRO_MESO}/changelog/#${TAG}"
24+
# echo "See [docs/changelog/#${TAG}](${URL}) for more details." >> notes.md
25+
26+
# Remove leading and trailing empty lines
27+
sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' -i notes.md

.github/workflows/release.yaml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# This workflow is adapted from:
2+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3+
4+
name: release
5+
on:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- 'v*'
11+
12+
env:
13+
# This is not critical
14+
# It is used only for showing URLs in GitHub Actions web interface.
15+
PYPI_NAME: soapboxslide
16+
TITLE: Soap Box Slide
17+
18+
jobs:
19+
build:
20+
name: Build distribution
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.11'
31+
- name: Install pypa/build
32+
run: >-
33+
python -m pip install build
34+
- name: Build package
35+
run: >-
36+
python -m build
37+
- name: Store the distribution packages
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: python-package-distributions
41+
path: dist/
42+
- name: Run release notes script
43+
run: >-
44+
.github/scripts/extract-notes.sh
45+
'${{ github.repository }}'
46+
'${{ github.ref }}'
47+
- name: Store the release notes
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: release-notes
51+
path: notes.md
52+
53+
publish-to-pypi:
54+
name: Publish Python distribution to PyPI
55+
if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: pypi
61+
url: https://pypi.org/p/${{ env.PYPI_NAME }}
62+
permissions:
63+
id-token: write
64+
65+
steps:
66+
- name: Download all the dists
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
- name: Publish distribution to PyPI
72+
uses: pypa/gh-action-pypi-publish@release/v1
73+
74+
github-release:
75+
name: >-
76+
Sign the Python distribution with Sigstore
77+
and upload them to GitHub Release
78+
needs:
79+
- publish-to-pypi
80+
runs-on: ubuntu-latest
81+
82+
permissions:
83+
contents: write
84+
id-token: write
85+
86+
steps:
87+
- name: Download all the dists
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: python-package-distributions
91+
path: dist/
92+
- name: Download the release notes
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: release-notes
96+
- name: Sign the dists with Sigstore
97+
uses: sigstore/gh-action-sigstore-python@v3.0.0
98+
with:
99+
inputs: >-
100+
./dist/*.tar.gz
101+
./dist/*.whl
102+
- name: Create GitHub Release
103+
env:
104+
GITHUB_TOKEN: ${{ github.token }}
105+
run: >-
106+
gh release create '${{ github.ref_name }}'
107+
--repo '${{ github.repository }}'
108+
--title '${{ env.TITLE }} ${{ github.ref_name }}'
109+
--notes-file notes.md
110+
- name: Upload artifact signatures to GitHub Release
111+
env:
112+
GITHUB_TOKEN: ${{ github.token }}
113+
# Upload to GitHub Release using the `gh` CLI.
114+
# `dist/` contains the built packages, and the
115+
# sigstore-produced signatures and certificates.
116+
run: >-
117+
gh release upload
118+
'${{ github.ref_name }}'
119+
dist/**
120+
--repo '${{ github.repository }}'
121+
122+
publish-to-testpypi:
123+
name: Publish Python distribution to TestPyPI
124+
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'reproducible-reporting'}}
125+
needs:
126+
- build
127+
runs-on: ubuntu-latest
128+
129+
environment:
130+
name: testpypi
131+
url: https://test.pypi.org/p/${{ env.PYPI_NAME }}
132+
133+
permissions:
134+
id-token: write
135+
136+
steps:
137+
- name: Download all the dists
138+
uses: actions/download-artifact@v4
139+
with:
140+
name: python-package-distributions
141+
path: dist/
142+
- name: Publish distribution to TestPyPI
143+
uses: pypa/gh-action-pypi-publish@release/v1
144+
with:
145+
repository-url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__pycache__
2+
dist
3+
*.egg-info

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: ["--maxkb=500"]
7+
- id: check-ast
8+
- id: check-case-conflict
9+
- id: check-executables-have-shebangs
10+
- id: check-json
11+
- id: check-merge-conflict
12+
- id: check-symlinks
13+
- id: check-vcs-permalinks
14+
- id: check-yaml
15+
- id: debug-statements
16+
- id: detect-private-key
17+
- id: destroyed-symlinks
18+
- id: end-of-file-fixer
19+
- id: fix-byte-order-marker
20+
- id: mixed-line-ending
21+
- id: pretty-format-json
22+
args: ["--autofix", "--no-sort-keys"]
23+
- id: trailing-whitespace
24+
exclude: \.aux$
25+
- repo: https://github.com/Lucas-C/pre-commit-hooks
26+
rev: v1.5.5
27+
hooks:
28+
- id: remove-crlf
29+
exclude_types: [binary]
30+
- repo: https://github.com/astral-sh/ruff-pre-commit
31+
rev: v0.14.0
32+
hooks:
33+
- id: ruff-format
34+
- id: ruff
35+
args: ["--fix", "--show-fixes"]
36+
- repo: https://github.com/python-jsonschema/check-jsonschema
37+
rev: 0.34.0
38+
hooks:
39+
- id: check-github-workflows

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4+
and this project adheres to [Effort-based Versioning](https://jacobtomlinson.dev/effver/).
5+
(Changes to features documented as "experimental" will not increment macro and meso version numbers.)
6+
7+
## [Unreleased]
8+
9+
(no changes yet)
10+
11+
## [1.0.0] - 2025-10-11
12+
13+
Initial release, just to get things started.
14+
15+
[Unreleased]: https://github.com/molmod/soapboxslide
16+
[1.0.0]: https://github.com/molmod/soapboxslide/releases/tag/v1.0.0

0 commit comments

Comments
 (0)