Skip to content

Commit

Permalink
fix(ci): Retitle old docs, pull main at each step
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Nov 15, 2023
1 parent 92c2b89 commit 53f096a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ jobs:
with:
github_token: ${{ secrets.PUSH_ACCESS }}
debug: true

build:
needs: [bump]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "main" # Necessary to download the latest of main as this will have been updated on the step before
fetch-tags: 1
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -67,12 +72,14 @@ jobs:
with:
name: build-output
path: dist

docs:
needs: [bump]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "main" # Necessary to download the latest of main as this will have been updated on the step before
fetch-tags: 1
fetch-depth: 0
- uses: actions/setup-python@v4
Expand All @@ -87,6 +94,14 @@ jobs:
git config user.name doc-bot
git config user.email [email protected]
current_version=$(git tag | sort --version-sort | tail -n 1)
# This block will rename previous retitled versions
retitled_versions=$(mike list -j | jq ".[] | select(.title != .version) | .version")
for version in $retitled_versions; do
mike retitle "${version}" "${version}"
done
echo "Deploying docs for ${current_version}"
mike deploy \
--push \
--title "${current_version} (latest)" \
Expand All @@ -99,6 +114,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: "main" # Necessary to download the latest of main as this will have been updated on the step before
fetch-tags: 1
fetch-depth: 0
- uses: actions/download-artifact@v3
Expand All @@ -111,6 +127,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
current_version=$(git tag | sort --version-sort | tail -n 1)
echo "Release for ${current_version}"
gh release create \
--generate-notes \
--prerelease \
Expand All @@ -123,6 +140,8 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: "main" # Necessary to download the latest of main as this will have been updated on the step before
- uses: actions/download-artifact@v3
with:
name: build-output
Expand Down

0 comments on commit 53f096a

Please sign in to comment.