forked from meshtastic/Meshtastic-Apple
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 2.58 KB
/
Copy pathdocs-release-bundle.yml
File metadata and controls
67 lines (60 loc) · 2.58 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
name: Release Docs Bundle
# On every release tag, publish a GitHub Release whose asset is a version-pinned
# bundle of the canonical English docs. This gives meshtastic.org's sync-apple-docs
# job a stable artifact to pull from, so the website's Apple docs only change when a
# new app version is tagged — not on every docs commit to main.
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write # create the GitHub Release and upload the bundle asset
concurrency:
group: docs-release-bundle-${{ github.ref_name }}
cancel-in-progress: false
jobs:
bundle:
runs-on: ubuntu-latest
steps:
- name: Checkout (at the release tag)
uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Bundle canonical English docs
id: bundle
run: |
set -euo pipefail
archive="meshtastic-apple-docs-${{ steps.version.outputs.version }}.tar.gz"
# User + developer guides and their screenshots, preserving the repo's
# docs/ layout so the consumer reads the same paths it does today.
# Jekyll machinery (_config.yml, _data, _includes, Gemfile) is excluded.
tar -czf "$archive" \
docs/index.md \
docs/user.md \
docs/developer.md \
docs/user \
docs/developer \
docs/assets/screenshots
echo "archive=$archive" >> "$GITHUB_OUTPUT"
echo "Bundled $(tar -tzf "$archive" | wc -l | tr -d ' ') entries into $archive"
- name: Create or update the GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
tag="$GITHUB_REF_NAME"
archive="${{ steps.bundle.outputs.archive }}"
printf '%s\n' \
"Documentation bundle for ${tag}." \
"" \
"Canonical English user & developer guides (markdown + screenshots) frozen at this" \
"release, for syncing into meshtastic.org. Point the \`sync-apple-docs\` job at this" \
"release asset (\`${archive}\`) instead of the \`main\` branch so the site's Apple docs" \
"only change when a new app version is tagged." > release-notes.md
# Idempotent: a re-run (or a tag re-push) updates the existing release/asset.
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" "$archive" --clobber
else
gh release create "$tag" "$archive" --title "$tag" --notes-file release-notes.md
fi