-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #746 from filecoin-project/ipdx-auto-update-docs
ipdx: auto update docs on version changes (support new release system)
- Loading branch information
Showing
9 changed files
with
110 additions
and
4,176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.