Skip to content

Commit

Permalink
Merge pull request #746 from filecoin-project/ipdx-auto-update-docs
Browse files Browse the repository at this point in the history
ipdx: auto update docs on version changes (support new release system)
  • Loading branch information
rjan90 authored Sep 25, 2024
2 parents 159bc80 + b4d2f97 commit 4f113ca
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 4,176 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bump Lotus Version

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
bump-version:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Get the latest release
id: get_release
run: |
REPO="filecoin-project/lotus"
RELEASES_TAGS=$(curl -s "https://api.github.com/repos/${REPO}/releases" | jq -r '.[] | select(.prerelease == false) | .tag_name')
get_latest_release() {
local TAG_PREFIX=$1
local RELEASES_TAGS_WITH_PREFIX=$(echo "$RELEASES_TAGS" | grep "${TAG_PREFIX}")
if [ -z "$RELEASES_TAGS_WITH_PREFIX" ]; then
exit 1
fi
local LATEST_RELEASE=$(echo "$RELEASES_TAGS_WITH_PREFIX" | sort -V | tail -n 1)
if [ -z "$LATEST_RELEASE" ]; then
exit 1
fi
echo "${LATEST_RELEASE#$TAG_PREFIX}"
}
latest_lotus=$(get_latest_release "v")
latest_miner=$(get_latest_release "miner/v")
echo "latest_lotus=$latest_lotus" >> $GITHUB_OUTPUT
echo "latest_miner=$latest_miner" >> $GITHUB_OUTPUT
- name: Update version.json
run: |
jq --arg lotus "$LATEST_LOTUS" --arg miner "$LATEST_MINER" '.lotus = $lotus | .miner = $miner' data/version.json > data/version.tmp && mv data/version.tmp data/version.json
env:
LATEST_LOTUS: ${{ steps.get_release.outputs.latest_lotus }}
LATEST_MINER: ${{ steps.get_release.outputs.latest_miner }}

- name: Check if changes exist
id: git_diff
run: |
git diff --exit-code || echo "has_changes=true" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.git_diff.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: bump-lotus-version
title: "Bump Lotus versions (node=${{ steps.get_release.outputs.latest_lotus }}, miner=${{ steps.get_release.outputs.latest_miner }})"
body: "This PR bumps the Lotus versions to node=${{ steps.get_release.outputs.latest_lotus }}, miner=${{ steps.get_release.outputs.latest_miner }}."
commit-message: "Bump Lotus versions to node=${{ steps.get_release.outputs.latest_lotus }}, miner=${{ steps.get_release.outputs.latest_miner }}."
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
add-paths: |
data/version.json
15 changes: 7 additions & 8 deletions content/en/lotus/install/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,22 @@ Amazon Linux 2:
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; sudo yum install -y hwloc-devel
```


1. Download the latest Linux bundle from the [Lotus GitHub releases page](https://github.com/filecoin-project/lotus/releases/latest):

```shell
wget https://github.com/filecoin-project/lotus/releases/download/v1.28.1/lotus_v1.28.1_linux_amd64.tar.gz
wget https://github.com/filecoin-project/lotus/releases/download/v{{< version >}}/lotus_v{{< version >}}_linux_amd64.tar.gz
```

1. Extract tar -xvf archive.tar.gz executable:
2. Extract tar -xvf archive.tar.gz executable:

```shell
tar -xvf lotus_v1.28.1_linux_amd64.tar.gz
tar -xvf lotus_v{{< version >}}_linux_amd64.tar.gz
```

1. Move the `lotus` binary to `/usr/local/bin`:
3. Move the `lotus` binary to `/usr/local/bin`:

```shell
sudo mv lotus_1.28.1_linux_amd64/lotus /usr/local/bin/lotus
sudo mv lotus_{{< version >}}_linux_amd64/lotus /usr/local/bin/lotus
```

## Building from source
Expand Down Expand Up @@ -126,10 +125,10 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

### Go

To build Lotus, you need a working installation of [Go 1.21.7 or higher](https://golang.org/dl/):
To build Lotus, you need a working installation of [Go {{< version "go" >}} or higher](https://golang.org/dl/):

```shell
wget -c https://golang.org/dl/go1.21.7.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
wget -c https://golang.org/dl/go{{< version "go" >}}.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
```

{{< alert icon="tip">}}
Expand Down
Loading

0 comments on commit 4f113ca

Please sign in to comment.