mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
ci: use correct github tag in docs source links (#10163)
* ci: use correct github tag in docs source links * fix: also apply on new tags
This commit is contained in:
19
.github/workflows/documentation.yml
vendored
19
.github/workflows/documentation.yml
vendored
@@ -66,6 +66,17 @@ jobs:
|
|||||||
pnpm run build
|
pnpm run build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
- name: Extract package and semver from tag
|
||||||
|
if: ${{ env.REF_TYPE == 'tag' }}
|
||||||
|
id: extract-tag
|
||||||
|
uses: ./packages/actions/src/formatTag
|
||||||
|
with:
|
||||||
|
tag: ${{ inputs.ref || github.ref_name }}
|
||||||
|
|
||||||
|
- name: Apply tag to api-extractor config
|
||||||
|
if: ${{ env.REF_TYPE == 'tag' && !inputs.ref }}
|
||||||
|
run: sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ steps.extract-tag.outputs.semver }}!' "packages/${{ steps.extract-tag.outputs.package}}/"
|
||||||
|
|
||||||
- name: Build docs
|
- name: Build docs
|
||||||
run: pnpm run docs
|
run: pnpm run docs
|
||||||
|
|
||||||
@@ -75,6 +86,7 @@ jobs:
|
|||||||
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws")
|
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws")
|
||||||
for PACKAGE in "${PACKAGES[@]}"; do
|
for PACKAGE in "${PACKAGES[@]}"; do
|
||||||
cd "packages/${PACKAGE}"
|
cd "packages/${PACKAGE}"
|
||||||
|
sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ inputs.ref }}!' api-extractor.json
|
||||||
../../main/packages/api-extractor/bin/api-extractor run --local --minify
|
../../main/packages/api-extractor/bin/api-extractor run --local --minify
|
||||||
../../main/packages/scripts/bin/generateSplitDocumentation
|
../../main/packages/scripts/bin/generateSplitDocumentation
|
||||||
cd ../..
|
cd ../..
|
||||||
@@ -87,13 +99,6 @@ jobs:
|
|||||||
token: ${{ secrets.DJS_DOCS }}
|
token: ${{ secrets.DJS_DOCS }}
|
||||||
path: 'out'
|
path: 'out'
|
||||||
|
|
||||||
- name: Extract package and semver from tag
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' }}
|
|
||||||
id: extract-tag
|
|
||||||
uses: ./packages/actions/src/formatTag
|
|
||||||
with:
|
|
||||||
tag: ${{ inputs.ref || github.ref_name }}
|
|
||||||
|
|
||||||
- name: Upload documentation to database
|
- name: Upload documentation to database
|
||||||
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user