-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1241 from twm/gha-release
GHA release pipeline
- Loading branch information
Showing
9 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,13 @@ name: CI | |
on: | ||
push: | ||
branches: ["trunk"] | ||
tags: ["v*"] | ||
pull_request: | ||
branches: ["trunk"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tox: | ||
name: "tox -e ${{ matrix.tox-env }}" | ||
|
@@ -21,6 +25,8 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -32,8 +38,8 @@ jobs: | |
- run: "python -m pip install tox" | ||
|
||
# Temporary hack: create files normally created by Webpack that are | ||
# expected to exist by the manifest.json view test. | ||
# Temporary hack: create files normally created by bin/compile-static.py | ||
# that are expected to exist by the manifest.json view test. | ||
- run: | | ||
mkdir yarrharr/static | ||
touch yarrharr/static/{icon,logotype,lettertype}-xyz.{ico,png,svg} | ||
|
@@ -42,13 +48,13 @@ jobs: | |
- run: "python -m tox" | ||
|
||
webpack: | ||
name: "tox -e static" | ||
|
||
build: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: apt install | ||
run: | | ||
|
@@ -67,3 +73,42 @@ jobs: | |
- run: "python -m tox -e static --notest" | ||
|
||
- run: "tox -e static" | ||
|
||
- run: "bin/release.sh" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/*.* | ||
if-no-files-found: error | ||
|
||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [build] | ||
|
||
runs-on: ubuntu-24.04 | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
- run: | | ||
set -eux | ||
tag="${TAG_REF##*/}" | ||
version=${tag#v} | ||
gh release create "$tag" \ | ||
--repo twm/yarrharr \ | ||
--verify-tag \ | ||
--title "Yarrharr $version" \ | ||
--generate-notes \ | ||
"dist/yarrharr-${version}.tar.gz" \ | ||
"dist/yarrharr-${version}"*.whl | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
TAG_REF: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -exu -o pipefail | ||
git diff --quiet HEAD || exit 1 | ||
tox -e release --notest | ||
version=$(.tox/release/bin/hatch version) | ||
.tox/release/bin/python -m build | ||
.tox/release/bin/python -m twine check "dist/yarrharr-${version}.tar.gz" "dist/yarrharr-${version}-py3-none-any.whl" | ||
git tag "v${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
build | ||
twine | ||
hatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
# such a combination shall include the source code for the parts of | ||
# OpenSSL used as well as that of the covered work. | ||
|
||
from importlib.metadata import version | ||
|
||
__author__ = "Tom Most" | ||
__author_email__ = "[email protected]" | ||
__version__ = "2024.11.0" | ||
__version__ = version("yarrharr") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Provides yarrharr version information. | ||
""" | ||
|
||
# This file is auto-generated! Do not edit! | ||
# Use `incremental` to change this file. | ||
|
||
from incremental import Version | ||
|
||
__version__ = Version("yarrharr", 24, 11, 0) | ||
__all__ = ["__version__"] |