Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto update ipfs version in installation docs #1081

Merged
merged 3 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/update-on-new-ipfs-tag/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ else
make
http-api-docs > $API_FILE

# update installation docs
cd $ROOT # go back to root of ipfs-docs repo
CURRENT_IPFS_NUMBER=${CURRENT_IPFS_TAG:1}
LATEST_IPFS_NUMBER=${LATEST_IPFS_TAG:1}
while read -r file; do
echo "replacing $CURRENT_IPFS_NUMBER with $LATEST_IPFS_NUMBER in $file"
sed -E -i "s/$CURRENT_IPFS_NUMBER/$LATEST_IPFS_NUMBER/g" $file
done <<< "$(grep "current-ipfs-version" ./docs -R --files-with-matches)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurentsenta turns out when <<< is used we need to make sure we use bash and not sh – see fix in #1121


# update cli docs
cd $ROOT # go back to root of ipfs-docs repo
git clone https://github.com/ipfs/go-ipfs.git
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-on-new-ipfs-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ steps.update.outputs.updated_branch }}
destination_branch: "main"
pr_title: "Bump CLI and HTTP API reference to go-ipfs ${{ steps.latest_ipfs.outputs.latest_tag }}"
pr_title: "Bump references to go-ipfs ${{ steps.latest_ipfs.outputs.latest_tag }}"
pr_body: "Release Notes: https://github.com/ipfs/go-ipfs/releases/${{ steps.latest_ipfs.outputs.latest_tag }}"
pr_label: "needs/triage,P0"
1 change: 1 addition & 0 deletions docs/install/command-line.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Command-line
description: Using IPFS through the command-line allows you to do everything that IPFS Desktop can do, but at a more granular level since you can specify which commands to run. Learn how to install it here.
current-ipfs-version: v0.12.0
---
Copy link
Contributor Author

@laurentsenta laurentsenta Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting here so we get a thread & trace some research:

Needs small fixes but overall I think it'd be a quick win here if the maintainers are OK with it. Another approach would be to adopt some proper templating engine for docs generation and use ipfs tag as an input but that's a major undertaking compared to this change so I think we can put it off for now.

Agreed, thanks for the feedback @galargh,

FWIW:

There is also a templating feature in vuepress,
but the syntax seems to break markdown URLs. This won't be transformed into a link:

[my link](https://mysite.com/{{ $frontmatter.myVariable }})

And we can't use templating in code blocks.

We could write vuepress plugins, but it would be more time-consuming & invasive.


# Command-line
Expand Down