mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-12-11 11:24:28 +03:00
Consolidate workflow to fetch bladebit (#15941)
* Consolidating bladebit fetch * Using a portable sed command * Whitespace
This commit is contained in:
parent
b1ecb5e154
commit
6c2c7bd6af
@ -116,58 +116,38 @@ jobs:
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot_k34
|
||||
|
||||
- name: Get latest bladebit plotter for Full Release
|
||||
if: "github.event.release && !github.event.release.prerelease"
|
||||
- name: Fetch bladebit versions
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Fetch the latest version of each type
|
||||
LATEST_RELEASE=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RELEASE" -p 'bladebit*-ubuntu-arm64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest beta bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'beta'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BETA=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BETA" -p 'bladebit*-ubuntu-arm64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest RC bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'rc'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_RC=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RC" -p 'bladebit*-ubuntu-arm64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest bladebit plotter for Dev
|
||||
if: "!github.event.release"
|
||||
# Compare the versions and choose the newest that matches the requirements
|
||||
if [[ "$TAG_TYPE" == "beta" || -z "${{ github.event.release.tag_name }}" ]]; then
|
||||
# For beta or dev builds (indicated by the absence of a tag), use the latest version available
|
||||
LATEST_VERSION=$(printf "%s\n%s\n%s\n" "$LATEST_RELEASE" "$LATEST_BETA" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
elif [[ "$TAG_TYPE" == "rc" ]]; then
|
||||
# For RC builds, use the latest RC or full release if it's newer
|
||||
LATEST_VERSION=$(printf "%s\n%s\n" "$LATEST_RELEASE" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
else
|
||||
# For full releases, use the latest full release
|
||||
LATEST_VERSION="$LATEST_RELEASE"
|
||||
fi
|
||||
echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Get latest bladebit plotter
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease and (.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-(beta|rc)[0-9]+$")))) | first | .tag_name')
|
||||
# Download and extract the chosen version
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BLADEBIT" -p 'bladebit*-ubuntu-arm64.tar.gz'
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_VERSION" -p 'bladebit*-ubuntu-arm64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
60
.github/workflows/build-linux-installer-deb.yml
vendored
60
.github/workflows/build-linux-installer-deb.yml
vendored
@ -116,58 +116,38 @@ jobs:
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot_k34
|
||||
|
||||
- name: Get latest bladebit plotter for Full Release
|
||||
if: "github.event.release && !github.event.release.prerelease"
|
||||
- name: Fetch bladebit versions
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Fetch the latest version of each type
|
||||
LATEST_RELEASE=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RELEASE" -p 'bladebit*-ubuntu-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest beta bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'beta'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BETA=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BETA" -p 'bladebit*-ubuntu-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest RC bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'rc'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_RC=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RC" -p 'bladebit*-ubuntu-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest bladebit plotter for Dev
|
||||
if: "!github.event.release"
|
||||
# Compare the versions and choose the newest that matches the requirements
|
||||
if [[ "$TAG_TYPE" == "beta" || -z "${{ github.event.release.tag_name }}" ]]; then
|
||||
# For beta or dev builds (indicated by the absence of a tag), use the latest version available
|
||||
LATEST_VERSION=$(printf "%s\n%s\n%s\n" "$LATEST_RELEASE" "$LATEST_BETA" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
elif [[ "$TAG_TYPE" == "rc" ]]; then
|
||||
# For RC builds, use the latest RC or full release if it's newer
|
||||
LATEST_VERSION=$(printf "%s\n%s\n" "$LATEST_RELEASE" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
else
|
||||
# For full releases, use the latest full release
|
||||
LATEST_VERSION="$LATEST_RELEASE"
|
||||
fi
|
||||
echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Get latest bladebit plotter
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease and (.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-(beta|rc)[0-9]+$")))) | first | .tag_name')
|
||||
# Download and extract the chosen version
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BLADEBIT" -p 'bladebit*-ubuntu-x86-64.tar.gz'
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_VERSION" -p 'bladebit*-ubuntu-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
60
.github/workflows/build-linux-installer-rpm.yml
vendored
60
.github/workflows/build-linux-installer-rpm.yml
vendored
@ -115,58 +115,38 @@ jobs:
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot_k34
|
||||
|
||||
- name: Get latest bladebit plotter for Full Release
|
||||
if: "github.event.release && !github.event.release.prerelease"
|
||||
- name: Fetch bladebit versions
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Fetch the latest version of each type
|
||||
LATEST_RELEASE=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RELEASE" -p 'bladebit*-centos-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest beta bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'beta'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BETA=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BETA" -p 'bladebit*-centos-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest RC bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'rc'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_RC=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RC" -p 'bladebit*-centos-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest bladebit plotter for Dev
|
||||
if: "!github.event.release"
|
||||
# Compare the versions and choose the newest that matches the requirements
|
||||
if [[ "$TAG_TYPE" == "beta" || -z "${{ github.event.release.tag_name }}" ]]; then
|
||||
# For beta or dev builds (indicated by the absence of a tag), use the latest version available
|
||||
LATEST_VERSION=$(printf "%s\n%s\n%s\n" "$LATEST_RELEASE" "$LATEST_BETA" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
elif [[ "$TAG_TYPE" == "rc" ]]; then
|
||||
# For RC builds, use the latest RC or full release if it's newer
|
||||
LATEST_VERSION=$(printf "%s\n%s\n" "$LATEST_RELEASE" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
else
|
||||
# For full releases, use the latest full release
|
||||
LATEST_VERSION="$LATEST_RELEASE"
|
||||
fi
|
||||
echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Get latest bladebit plotter
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease and (.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-(beta|rc)[0-9]+$")))) | first | .tag_name')
|
||||
# Download and extract the chosen version
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BLADEBIT" -p 'bladebit*-centos-x86-64.tar.gz'
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_VERSION" -p 'bladebit*-centos-x86-64.tar.gz'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
80
.github/workflows/build-macos-installers.yml
vendored
80
.github/workflows/build-macos-installers.yml
vendored
@ -150,74 +150,42 @@ jobs:
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot
|
||||
chmod +x "$GITHUB_WORKSPACE"/madmax/chia_plot_k34
|
||||
|
||||
- name: Get latest bladebit plotter for Full Release
|
||||
if: "github.event.release && !github.event.release.prerelease"
|
||||
- name: Fetch bladebit versions
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Fetch the latest version of each type
|
||||
LATEST_RELEASE=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
ASSETS=$(gh release view "$LATEST_RELEASE" --repo Chia-Network/bladebit --json assets -q '.assets[].name')
|
||||
if ! echo "$ASSETS" | grep -q 'bladebit.*-${{ matrix.os.bladebit-suffix }}'; then
|
||||
LATEST_RELEASE=v2.0.1
|
||||
fi
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RELEASE" -p 'bladebit*-${{ matrix.os.bladebit-suffix }}'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest beta bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'beta'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BETA=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
ASSETS=$(gh release view "$LATEST_BETA" --repo Chia-Network/bladebit --json assets -q '.assets[].name')
|
||||
if ! echo "$ASSETS" | grep -q 'bladebit.*-${{ matrix.os.bladebit-suffix }}'; then
|
||||
LATEST_BETA=v2.0.1
|
||||
fi
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BETA" -p 'bladebit*-${{ matrix.os.bladebit-suffix }}'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest RC bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'rc'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_RC=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
ASSETS=$(gh release view "$LATEST_RC" --repo Chia-Network/bladebit --json assets -q '.assets[].name')
|
||||
if ! echo "$ASSETS" | grep -q 'bladebit.*-${{ matrix.os.bladebit-suffix }}'; then
|
||||
LATEST_RC=v2.0.1
|
||||
fi
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RC" -p 'bladebit*-${{ matrix.os.bladebit-suffix }}'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest bladebit plotter for Dev
|
||||
if: "!github.event.release"
|
||||
# Compare the versions and choose the newest that matches the requirements
|
||||
if [[ "$TAG_TYPE" == "beta" || -z "${{ github.event.release.tag_name }}" ]]; then
|
||||
# For beta or dev builds (indicated by the absence of a tag), use the latest version available
|
||||
LATEST_VERSION=$(printf "%s\n%s\n%s\n" "$LATEST_RELEASE" "$LATEST_BETA" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
elif [[ "$TAG_TYPE" == "rc" ]]; then
|
||||
# For RC builds, use the latest RC or full release if it's newer
|
||||
LATEST_VERSION=$(printf "%s\n%s\n" "$LATEST_RELEASE" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
else
|
||||
# For full releases, use the latest full release
|
||||
LATEST_VERSION="$LATEST_RELEASE"
|
||||
fi
|
||||
echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Get latest bladebit plotter
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease and (.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-(beta|rc)[0-9]+$")))) | first | .tag_name')
|
||||
# Download and extract the chosen version
|
||||
mkdir "$GITHUB_WORKSPACE"/bladebit
|
||||
cd "$GITHUB_WORKSPACE"/bladebit
|
||||
ASSETS=$(gh release view "$LATEST_BLADEBIT" --repo Chia-Network/bladebit --json assets -q '.assets[].name')
|
||||
if ! echo "$ASSETS" | grep -q 'bladebit.*-${{ matrix.os.bladebit-suffix }}'; then
|
||||
LATEST_BLADEBIT=v2.0.1
|
||||
fi
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BLADEBIT" -p 'bladebit*-${{ matrix.os.bladebit-suffix }}'
|
||||
ASSETS=$(gh release view "$LATEST_VERSION" --repo Chia-Network/bladebit --json assets -q '.assets[].name')
|
||||
if ! echo "$ASSETS" | grep -q 'bladebit.*-${{ matrix.os.bladebit-suffix }}'; then
|
||||
LATEST_VERSION=v2.0.1
|
||||
fi
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_VERSION" -p 'bladebit*-${{ matrix.os.bladebit-suffix }}'
|
||||
ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}'
|
||||
ls bladebit* | xargs -I{} chmod +x {}
|
||||
cd "$OLDPWD"
|
||||
|
57
.github/workflows/build-windows-installer.yml
vendored
57
.github/workflows/build-windows-installer.yml
vendored
@ -160,55 +160,38 @@ jobs:
|
||||
gh release download -R Chia-Network/chia-plotter-madmax "$LATEST_MADMAX" -p 'chia_plot-*.exe' -O "$GITHUB_WORKSPACE"\\madmax\\chia_plot.exe
|
||||
gh release download -R Chia-Network/chia-plotter-madmax "$LATEST_MADMAX" -p 'chia_plot_k34-*.exe' -O "$GITHUB_WORKSPACE"\\madmax\\chia_plot_k34.exe
|
||||
|
||||
- name: Get latest bladebit plotter for Full Release
|
||||
if: "github.event.release && !github.event.release.prerelease"
|
||||
- name: Fetch bladebit versions
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Fetch the latest version of each type
|
||||
LATEST_RELEASE=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE\\bladebit"
|
||||
cd "$GITHUB_WORKSPACE\\bladebit"
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RELEASE" -p 'bladebit*windows-x86-64.zip'
|
||||
ls *.zip | xargs -I{} bash -c 'unzip {} && rm {}'
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest beta bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'beta'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BETA=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE\\bladebit"
|
||||
cd "$GITHUB_WORKSPACE\\bladebit"
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BETA" -p 'bladebit*windows-x86-64.zip'
|
||||
ls *.zip | xargs -I{} bash -c 'unzip {} && rm {}'
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest RC bladebit plotter
|
||||
if: "github.event.release && github.event.release.prerelease || env.TAG_TYPE == 'rc'"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_RC=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease) | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+$"))) | first | .tag_name')
|
||||
mkdir "$GITHUB_WORKSPACE\\bladebit"
|
||||
cd "$GITHUB_WORKSPACE\\bladebit"
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_RC" -p 'bladebit*windows-x86-64.zip'
|
||||
ls *.zip | xargs -I{} bash -c 'unzip {} && rm {}'
|
||||
cd "$OLDPWD"
|
||||
|
||||
- name: Get latest bladebit plotter for Dev
|
||||
if: "!github.event.release"
|
||||
# Compare the versions and choose the newest that matches the requirements
|
||||
if [[ "$TAG_TYPE" == "beta" || -z "${{ github.event.release.tag_name }}" ]]; then
|
||||
# For beta or dev builds (indicated by the absence of a tag), use the latest version available
|
||||
LATEST_VERSION=$(printf "%s\n%s\n%s\n" "$LATEST_RELEASE" "$LATEST_BETA" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
elif [[ "$TAG_TYPE" == "rc" ]]; then
|
||||
# For RC builds, use the latest RC or full release if it's newer
|
||||
LATEST_VERSION=$(printf "%s\n%s\n" "$LATEST_RELEASE" "$LATEST_RC" | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1)
|
||||
else
|
||||
# For full releases, use the latest full release
|
||||
LATEST_VERSION="$LATEST_RELEASE"
|
||||
fi
|
||||
echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Get latest bladebit plotter
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease and (.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-(beta|rc)[0-9]+$")))) | first | .tag_name')
|
||||
# Download and extract the chosen version
|
||||
mkdir "$GITHUB_WORKSPACE\\bladebit"
|
||||
cd "$GITHUB_WORKSPACE\\bladebit"
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_BLADEBIT" -p 'bladebit*windows-x86-64.zip'
|
||||
gh release download -R Chia-Network/bladebit "$LATEST_VERSION" -p 'bladebit*windows-x86-64.zip'
|
||||
ls *.zip | xargs -I{} bash -c 'unzip {} && rm {}'
|
||||
cd "$OLDPWD"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user