-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (88 loc) · 2.43 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches: ["trunk"]
tags: ["v*"]
pull_request:
branches: ["trunk"]
permissions:
contents: read
jobs:
tox:
name: "tox -e ${{ matrix.tox-env }}"
strategy:
matrix:
tox-env: ["test", "lint"]
runs-on: ubuntu-24.04
env:
TOXENV: "${{ matrix.tox-env }}"
RUFF_OUTPUT_FORMAT: "github"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/[email protected]
with:
python-version: "3.9"
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements_*.txt
- run: "python -m pip install tox"
# 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}
touch yarrharr/static/{normalize,main,fonts}-xyz.css
touch yarrharr/static/{runtime,vendor,main}-xyz.js
- run: "python -m tox"
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: apt install
run: |
sudo apt-get update
sudo apt-get install --no-install-suggests --no-install-recommends inkscape icoutils scour optipng
- uses: actions/[email protected]
with:
python-version: "3.9"
cache: 'pip'
cache-dependency-path: |
requirements_static.txt
- run: "python -m pip install tox"
- 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 -x
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:
TAG_REF: "${{ github.ref }}"