🚚 Rename OpenAPI artifact (#3621)

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>
pull/3632/head
Alexandre Franke 3 years ago committed by GitHub
parent 56532dd688
commit 7e92964dc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,18 +71,18 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: "📦 Asset creation" - name: "📦 Asset creation"
run: | run: |
mkdir -p assets
python3 -m venv env && . env/bin/activate python3 -m venv env && . env/bin/activate
pip install -r scripts/requirements.txt pip install -r scripts/requirements.txt
# The output path matches the final deployment path at spec.matrix.org
scripts/dump-swagger.py \ scripts/dump-swagger.py \
--base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \
-o assets/spec/client_server/api.json -o spec/client-server-api/api.json
tar -czf assets.tar.gz assets tar -czf openapi.tar.gz spec
- name: "📤 Artifact upload" - name: "📤 Artifact upload"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: openapi-artifact name: openapi-artifact
path: assets.tar.gz path: openapi.tar.gz
build-spec: build-spec:
name: "📖 Build the spec" name: "📖 Build the spec"
@ -109,7 +109,7 @@ jobs:
- name: "⚙️ hugo" - name: "⚙️ hugo"
run: hugo --baseURL "${{ needs.calculate-baseurl.outputs.baseURL }}" -d "spec" run: hugo --baseURL "${{ needs.calculate-baseurl.outputs.baseURL }}" -d "spec"
# We manually copy the spec OpenAPI definition JSON to the website tree # We manually unpack the spec OpenAPI definition JSON to the website tree
# to make it available to the world in a canonical place: # to make it available to the world in a canonical place:
# https://spec.matrix.org/latest/client-server-api/api.json # https://spec.matrix.org/latest/client-server-api/api.json
# Works for /unstable/ and /v1.1/ as well. # Works for /unstable/ and /v1.1/ as well.
@ -117,10 +117,9 @@ jobs:
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: openapi-artifact name: openapi-artifact
- name: "📝 Copy the definition to the right location" - name: "📝 Unpack the OpenAPI definitions in the right location"
run: | run: |
tar -xzf assets.tar.gz tar -xzf openapi.tar.gz
cp assets/spec/client_server/api.json spec/client-server-api/
- name: "📦 Tarball creation" - name: "📦 Tarball creation"
run: tar -czf spec.tar.gz spec run: tar -czf spec.tar.gz spec
@ -159,15 +158,13 @@ jobs:
echo -e '[params.version]\nstatus="historical"' > historical.toml echo -e '[params.version]\nstatus="historical"' > historical.toml
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec" hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
# Copying the spec definition to the tree
- name: "📥 Spec definition download" - name: "📥 Spec definition download"
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: openapi-artifact name: openapi-artifact
- name: "📝 Copy the definition to the right location" - name: "📝 Unpack the OpenAPI definitions in the right location"
run: | run: |
tar -xzf assets.tar.gz tar -xzf openapi.tar.gz
cp assets/spec/client_server/api.json spec/client-server-api/
- name: "📦 Tarball creation" - name: "📦 Tarball creation"
run: tar -czf spec-historical.tar.gz spec run: tar -czf spec-historical.tar.gz spec

Loading…
Cancel
Save