diff --git a/.github/workflows/build-matrix.org.yml b/.github/workflows/build-matrix.org.yml index 1dca742945..4313152b43 100644 --- a/.github/workflows/build-matrix.org.yml +++ b/.github/workflows/build-matrix.org.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - # Fetch the latest spec build, and apply styling to it. + # Apply styling to the spec documents. # This step also sets up the OpenAPI UI. build-spec: name: "📖 Spec" @@ -18,14 +18,6 @@ jobs: uses: actions/checkout@v2 with: submodules: 'recursive' - - name: "📥 matrix-doc OpenAPI artifact download" - uses: dawidd6/action-download-artifact@6f8f427fb41886a66b82ea11a5a15d1454c79415 - with: - workflow: main.yml - workflow_conclusion: success - repo: ${{ github.repository_owner }}/matrix-doc - branch: main - name: openapi-artifact - name: "📖 Update docs" run: | python3 -m venv env diff --git a/scripts/fetch-buildkite-artifact b/scripts/fetch-buildkite-artifact deleted file mode 100755 index 62af04d86f..0000000000 --- a/scripts/fetch-buildkite-artifact +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -# fetch a buildkite artifact -# - -from __future__ import print_function - -import argparse -import os -import requests - -parser = argparse.ArgumentParser( - "fetch an artifact from buildkite" -) - -parser.add_argument( - "--access-token", - help=( - "Buildkite access token. If unset, will be read from the " - "BUILDKITE_ACCESS_TOKEN environment variable." - ), -) - -parser.add_argument( - "--build-filter", - default="branch=main&state=passed", - help="Query string for the build filter. Default: %(default)s", -) - -parser.add_argument("org_slug") -parser.add_argument("build_slug") -parser.add_argument("artifact_name") - -args=parser.parse_args() - -access_token=args.access_token -if access_token is None: - access_token = os.environ["BUILDKITE_ACCESS_TOKEN"] -artifact_name = args.artifact_name - -session = requests.Session() -session.headers["Authorization"] = "Bearer " + access_token - -# we start by fetching the REST url for the latest matching build -print("Fetching build list") -r = session.get( - "https://api.buildkite.com/v2/organizations/%s/pipelines/%s/builds?%s" % ( - args.org_slug, args.build_slug, args.build_filter, - ), -) -r.raise_for_status() -build_url = r.json()[0]["url"] - -# then we need to get the download_url for the artifact -print("Fetching artifact list") -r = session.get(build_url + "/artifacts") -r.raise_for_status() -artifact = next(a for a in r.json() if a["filename"] == artifact_name) -download_url = artifact["download_url"] - -# the download_url returns a 302 to the S3 URL. -print("Downloading artifact %s -> %s" % (download_url, artifact_name)) -r = session.get(download_url) -r.raise_for_status() -with open(artifact_name, "wb") as f: - f.write(r.content) - print("done") diff --git a/scripts/update_docs.sh b/scripts/update_docs.sh index eeacc61cf2..568ea0e433 100755 --- a/scripts/update_docs.sh +++ b/scripts/update_docs.sh @@ -2,9 +2,13 @@ # update_docs.sh: regenerates the autogenerated files on the matrix.org site. # At present this includes: -# * the spec intro and appendices -# * the guides and howtos -# * 'Unstable' versions of the spec docs +# +# * the spec intro and appendices, at https://matrix.org/docs/spec/ and +# https://matrix.org/docs/spec/appendices (though note that it is planned +# to move these to https://spec.matrix.org) +# +# * the guides and howtos at https://matrix.org/docs/develop/ +# # * the RapiDoc UI for the API # # Note that the historical versions of the CS spec and swagger, and the spec @@ -19,30 +23,11 @@ fi SELF="${SELF/\/.\///}" cd "$(dirname "$(dirname "${SELF}")")" -SITE_BASE="$(pwd)" - -if ! [ -z ${BUILDKITE_ACCESS_TOKEN+x} ]; then - # grab and unpack the latest matrix-docs build from buildkite - rm -rf assets.tar.gz assets - scripts/fetch-buildkite-artifact matrix-dot-org matrix-doc assets.tar.gz -fi - -# otherwise, assume the latest build was fetched by Github Actions. -tar -xzf assets.tar.gz - # Set up foundations for RapiDoc API playground rm -fr unstyled_docs/api/client-server mkdir -p unstyled_docs/api/client-server/json ln -s ../../../spec/client_server/latest.json unstyled_docs/api/client-server/json/api-docs.json -# and the unstable spec docs, but not: -# * the spec index (because we want to keep the git version, which points to a specific c-s version), or -# * the appendices, as we've frozen the old docs now and are not updating them until everything is moved over -# to the new spec redesign -rm -f assets/spec/index.html -rm -f assets/spec/appendices.html -cp -ar assets/spec unstyled_docs - # copy the unstyled docs and add the jekyll styling rm -rf content/docs cp -r unstyled_docs content/docs diff --git a/scripts/update_docs_local.sh b/scripts/update_docs_local.sh deleted file mode 100755 index dbc6628d7a..0000000000 --- a/scripts/update_docs_local.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -eux - -# update_docs.sh: regenerates the autogenerated files on the matrix.org site. -# At present this includes: -# * the spec intro and appendices -# * the guides and howtos -# * the swagger UI for the API -# * 'Unstable' versions of the spec docs -# -# Note that the historical versions of the CS spec and swagger, and the spec -# index, are generated manually within matrix-doc and then *committed to git*. - -# Note that this file is world-readable unless someone plays some .htaccess hijinks - -SELF="${BASH_SOURCE[0]}" -if [[ "${SELF}" != /* ]]; then - SELF="$(pwd)/${SELF}" -fi -SELF="${SELF/\/.\///}" -cd "$(dirname "$(dirname "${SELF}")")" - -SITE_BASE="$(pwd)" - -# grab and unpack the latest matrix-docs build from buildkite -rm -rf assets.tar.gz assets -scripts/fetch-buildkite-artifact matrix-dot-org matrix-doc assets.tar.gz -tar -xzf assets.tar.gz - -# copy the swagger UI into place -#rm -fr unstyled_docs/api/client-server -#cp -r swagger-ui/dist/* unstyled_docs/api/client-server/ -#mkdir -p unstyled_docs/api/client-server/json -#(cd unstyled_docs && patch -p0)