Skip to content

Commit 402148a

Browse files
committed
Setup publishing workflows
Workflows set up for `next` to publish to dev, and `main` to publish the versioned docs. `next` will publish when changes are merged, `main` will publish when a tag is created. Other changes made to the configuration file for cleanup and removal of variables that complicated workflow enablement, or served no real purpose. Ran action lint, minor but not breaking issues reported. This commit applies to FFTK-4532, "add dev version" This commit applies to FFTK-4116, "Use GitHub Action…" This commit applies to FFTK-4763, "test workflow…" Signed-off-by: Katrina Prosise <katrina.prosise@foundries.io>
1 parent 5fc8b00 commit 402148a

6 files changed

Lines changed: 141 additions & 46 deletions

File tree

.github/workflows/publish-dev.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: publish-dev
2+
on:
3+
push:
4+
branches:
5+
- 'next'
6+
paths:
7+
- 'source/**'
8+
- '.github/workflows/publish-dev.yml'
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
publish-dev:
14+
name: publish docs/dev
15+
runs-on: ubuntu-latest
16+
env:
17+
MEILISEARCH_INDEX_KEY: ${{ secrets.MEILISEARCH_INDEX_KEY }}
18+
MEILISEARCH_SEARCH_KEY: ${{ secrets.MEILISEARCH_SEARCH_KEY }}
19+
MEILISEARCH_HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
20+
ADOBE_ANALYTICS_URL: ${{ secrets.ADOBE_ANALYTICS_URL }}
21+
BUCKET_CREDS: ${{ secrets.BUCKET_CREDS }}
22+
23+
steps:
24+
- uses: actions/checkout@v6
25+
- uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.13'
28+
29+
- name: install dependencies
30+
run: |
31+
sudo apt update -y
32+
sudo apt-get install -y graphviz fonts-freefont-ttf
33+
pip3 install -U pip
34+
pip3 install -U gsutil==5.27 'pyOpenSSL<24.3.0'
35+
pip3 install --ignore-installed -r requirements.txt
36+
37+
- name: Add latest Fioctl docs
38+
run: |
39+
export fv=$(wget -q -O- https://api.github.com/repos/foundriesio/fioctl/releases/latest | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/')
40+
wget -O /tmp/fioctl https://github.com/foundriesio/fioctl/releases/download/${fv}/fioctl-linux-amd64
41+
chmod +x /tmp/fioctl
42+
/tmp/fioctl gen-rst source/appendix/fioctl-command-reference/
43+
44+
- name: Build docs
45+
run: |
46+
echo "Building dev docs"
47+
mkdir out
48+
make MP_UPDATE_VERSION="dev" OUTDIR=out SPHINXBUILD=sphinx-build html
49+
50+
- name: prepare docs for upload and publish docs
51+
run: |
52+
mv out/html out/dev
53+
cd out
54+
tar -czf offline-docs.tgz dev/
55+
mv offline-docs.tgz dev/
56+
echo $BUCKET_CREDS > secret
57+
echo -e "secret\nY\nosf-prod\nN\n" | gsutil config -e
58+
gsutil -m rsync -d -r dev gs://docs.foundries.io/dev

.github/workflows/publish-main.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: publish-release
2+
on:
3+
push:
4+
tags:
5+
- 'mp-**'
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish-stable:
11+
name: publish docs/stable
12+
runs-on: ubuntu-latest
13+
env:
14+
MEILISEARCH_INDEX_KEY: ${{ secrets.MEILISEARCH_INDEX_KEY }}
15+
MEILISEARCH_SEARCH_KEY: ${{ secrets.MEILISEARCH_SEARCH_KEY }}
16+
MEILISEARCH_HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
17+
ADOBE_ANALYTICS_URL: ${{ secrets.ADOBE_ANALYTICS_URL }}
18+
BUCKET_CREDS: ${{ secrets.BUCKET_CREDS }}
19+
TAG: ${{ github.ref_name }}
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.13'
26+
27+
- name: install dependencies
28+
run: |
29+
sudo apt update -y
30+
sudo apt-get install -y graphviz fonts-freefont-ttf
31+
pip3 install -U pip
32+
pip3 install -U gsutil==5.27 'pyOpenSSL<24.3.0'
33+
pip3 install --ignore-installed -r requirements.txt
34+
35+
- name: Add latest Fioctl docs
36+
run: |
37+
export fv=$(wget -q -O- https://api.github.com/repos/foundriesio/fioctl/releases/latest | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/')
38+
wget -O /tmp/fioctl https://github.com/foundriesio/fioctl/releases/download/${fv}/fioctl-linux-amd64
39+
chmod +x /tmp/fioctl
40+
/tmp/fioctl gen-rst source/appendix/fioctl-command-reference/
41+
42+
- name: set release name
43+
run: |
44+
echo "release tag: $TAG"
45+
# if [[ $TAG == mp-* ]]; then
46+
export RELEASE="$(echo $TAG | sed -r 's/^.{3}//')"
47+
# else
48+
# export RELEASE="$TAG"
49+
# fi
50+
echo "VERSION=$RELEASE" >> "$GITHUB_ENV"
51+
52+
- name: Build docs
53+
run: |
54+
echo "Building docs $VERSION"
55+
mkdir out
56+
make MP_UPDATE_VERSION="$VERSION" OUTDIR=out SPHINXBUILD=sphinx-build html
57+
58+
- name: prepare docs for upload and publish docs
59+
run: |
60+
mv out/html out/$VERSION
61+
cd out
62+
tar -czf offline-docs.tgz $VERSION/
63+
mv offline-docs.tgz $VERSION/
64+
echo $BUCKET_CREDS > secret
65+
echo -e "secret\nY\nosf-prod\nN\n" | gsutil config -e
66+
gsutil -m rsync -d -r dev gs://docs.foundries.io/$VERSION
67+
# if [[ $TAG == mp-* ]]; then
68+
gsutil -m rsync -d -r gs://docs.foundries.io/${VERSION} gs://docs.foundries.io/latest
69+
fi

source/_static/local-dev-switcher.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

source/_static/switcher.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"name": "dev (unstable)",
4+
"version": "dev",
5+
"url": "https://docs.foundries.io/dev"
6+
},
27
{
38
"name": "v96 (stable)",
49
"version": "96",

source/conf.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# Tags to append to the version, if any.
5151
# (This doesn't affect links to artifacts.)
5252
mp_tags = ''
53-
if mp_version.startswith('git-'):
53+
if mp_version.startswith('git-') or mp_version == 'dev':
5454
if pr == 'False':
5555
mp_tags = 'local-dev'
5656
else:
@@ -66,7 +66,7 @@
6666
search_version = 'default'
6767

6868
else:
69-
if mp_tags== 'dev' or mp_tags == 'local-dev':
69+
if mp_tags == 'dev' or mp_tags == 'local-dev':
7070
search_version = 'dev'
7171

7272
else:
@@ -92,7 +92,7 @@
9292

9393
#-- Get version used for link to offline docs page -----------------------------
9494

95-
if mp_version.startswith('git-'):
95+
if mp_version.startswith('git-') or mp_version == 'dev':
9696
gh_release = 'releases'
9797
else:
9898
gh_release = 'releases/tag/mp-' + mp_version
@@ -114,20 +114,11 @@
114114

115115
# Derive the subscriber tags to use for this build from the
116116
# corresponding version information.
117-
if mp_version.startswith('git-'):
117+
if mp_version.startswith('git-') or mp_version == 'dev':
118118
docker_tag = 'latest'
119119
else:
120120
docker_tag = mp_version
121121

122-
# Provide Git tags for the same information. (This can produce
123-
# somewhat strange command lines for development builds, like cloning
124-
# a repository and checking out master, but it works for subscriber
125-
# updates.)
126-
if mp_version.startswith('git-'):
127-
git_tag = 'main'
128-
else:
129-
git_tag = 'mp-' + mp_version + mp_tags
130-
131122
# And likewise for repo and west manifests (which have a different tag
132123
# namespace than the project tags, that happens to mostly match the
133124
# docker tags.)
@@ -140,10 +131,6 @@
140131
#parent_dir = dirname(dirname(abspath(__file__)))
141132
#sys.path.insert(0, join(parent_dir, 'extensions'))
142133

143-
# The version info for the project you're documenting, acts as replacement for
144-
# |version| and |release|, also used in various other places throughout the
145-
# built documents.
146-
#
147134
# The short X.Y version.
148135
version = mp_version
149136
# The full version, including alpha/beta/rc tags.
@@ -225,10 +212,9 @@
225212
# Standard epilog to be included in all files.
226213
rst_epilog = '''
227214
.. |docker_tag| replace:: {}
228-
.. |git_tag| replace:: {}
229215
.. |manifest_tag| replace:: {}
230216
.. |fioctl_version| replace:: {}
231-
'''.format(docker_tag, git_tag, manifest_tag, fioctl_version)
217+
'''.format(docker_tag, manifest_tag, fioctl_version)
232218

233219
# -- PDF Configuration --------------------------------------------------------
234220

@@ -251,12 +237,8 @@
251237
json_url = 'https://docs.foundries.io/latest/_static/switcher.json'
252238
version_match = release
253239
if "dev" in release:
254-
version_match = 'dev'
255-
if mp_tags == 'local-dev':
256-
json_url = '_static/local-dev-switcher.json'
257-
if mp_tags == 'dev':
258-
json_url = 'https://raw.githubusercontent.com/foundriesio/docs/refs/main/next/source/_static/switcher.json'
259-
240+
version_match= 'dev'
241+
json_url = 'https://raw.githubusercontent.com/foundriesio/docs/refs/heads/next/source/_static/switcher.json'
260242
# Pydata Theme options
261243
html_theme_options = {
262244
'pygments_light_style': 'default',

source/user-guide/lmp-customization/linux-building.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Setup
9191
9292
$ mkdir -p ~/lmp/sstate-cache ~/lmp/downloads ~/lmp/build
9393
94-
#. Run |version| of the container as the ``builder`` user:
94+
#. Run the container as the ``builder`` user:
9595

9696
.. parsed-literal::
9797
@@ -117,7 +117,7 @@ The `Google Repo`_ tool fetches Git repos at known-good revisions, and keeps the
117117
118118
$ cd build/lmp
119119
120-
#. Fetch release |version| using :term:`Repo`:
120+
#. Fetch release using :term:`Repo`:
121121

122122
.. parsed-literal::
123123

0 commit comments

Comments
 (0)