-
-
Notifications
You must be signed in to change notification settings - Fork 3k
77 lines (70 loc) · 2.56 KB
/
Copy pathrelease-downstreams.yml
File metadata and controls
77 lines (70 loc) · 2.56 KB
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
name: Release — downstream bump tracker
# Opens a single tracking issue on every release that lists every
# downstream distribution of Etherpad (see docs/downstreams.yml) with
# hints on whether they update automatically or need a manual PR.
#
# Rationale: external catalogs (CasaOS, TrueCharts, BBB, Unraid, …) go
# stale because nobody remembers to poke them at release time. This
# workflow turns "remember to update every downstream" into a checklist
# we can close methodically.
#
# To test before a real release: run `Actions → Release — downstream
# bump tracker → Run workflow`, supply a version (e.g. `2.6.1-test`).
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: Version string to use (e.g. 2.6.1). Defaults to the release tag.
required: true
permissions:
contents: read
issues: write
jobs:
open-tracking-issue:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
- name: Resolve version
id: v
env:
TAG: ${{ github.event.release.tag_name }}
# `inputs.version` only exists on workflow_dispatch; reading it on
# release events can yield an empty string or a context-evaluation
# error depending on GitHub Actions behavior. Pull the dispatch
# payload directly via github.event.inputs so release runs stay
# clean.
INPUT: ${{ github.event.inputs.version }}
EVENT: ${{ github.event_name }}
run: |
VERSION="${TAG:-$INPUT}"
VERSION="${VERSION#v}"
if [ -z "${VERSION}" ]; then
echo "Could not determine version (event=${EVENT})." >&2
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Render issue body
id: render
env:
VERSION: ${{ steps.v.outputs.version }}
run: |
python3 -m pip install --quiet pyyaml
BODY=$(mktemp)
python3 .github/scripts/render-downstream-tracker.py \
docs/downstreams.yml \
"$VERSION" \
"$GITHUB_REPOSITORY" \
> "$BODY"
echo "body-path=$BODY" >> "$GITHUB_OUTPUT"
- name: Open tracking issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue create \
--repo "$GITHUB_REPOSITORY" \
--title "Downstream bumps for ${{ steps.v.outputs.version }}" \
--label "release,downstream" \
--body-file '${{ steps.render.outputs.body-path }}'