Skip to content

Commit

Permalink
continue debugging workflow 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nick1udwig committed Sep 10, 2024
1 parent 7793283 commit ba6f778
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,40 @@ jobs:
rustup target add wasm32-wasi
rustup target add wasm32-wasi --toolchain nightly
cargo install cargo-wasi
- name: Get latest release from foundry-rs/foundry
id: get-latest-foundry-release
uses: actions/github-script@v6
with:
script: |
const repo = {
owner: 'foundry-rs',
repo: 'foundry',
per_page: 1,
page: 1,
};
const releases = await github.rest.repos.listReleases(repo);
const preReleases = releases.data.filter(release => release.prerelease);
#- name: Get latest release from foundry-rs/foundry
# id: get-latest-foundry-release
# uses: actions/github-script@v6
# with:
# script: |
# const repo = {
# owner: 'foundry-rs',
# repo: 'foundry',
# per_page: 1,
# page: 1,
# };
# const releases = await github.rest.repos.listReleases(repo);
# const preReleases = releases.data.filter(release => release.prerelease);

// Sort pre-releases by created_at date in descending order
preReleases.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
# // Sort pre-releases by created_at date in descending order
# preReleases.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));

if (preReleases.length === 0) {
throw new Error('No pre-releases found');
}
# if (preReleases.length === 0) {
# throw new Error('No pre-releases found');
# }

const latestPreRelease = preReleases[0];
const asset = latestPreRelease.assets.find(asset => asset.name.match(/foundry_nightly_linux_amd64\.tar\.gz/));
# const latestPreRelease = preReleases[0];
# const asset = latestPreRelease.assets.find(asset => asset.name.match(/foundry_nightly_linux_amd64\.tar\.gz/));

if (!asset) {
throw new Error('Asset not found');
}
return asset.browser_download_url;
result-encoding: string
# if (!asset) {
# throw new Error('Asset not found');
# }
# return asset.browser_download_url;
# result-encoding: string
- name: Download the Foundry release
run: wget -q ${DOWNLOAD_URL} -O foundry.tar.gz
env:
DOWNLOAD_URL: ${{ steps.get-latest-foundry-release.outputs.result }}
run: wget -q https://github.com/foundry-rs/foundry/releases/download/nightly-de596a4db781933f0c95805bd1c8c05e65f03d4f/foundry_nightly_linux_amd64.tar.gz -O foundry.tar.gz
#run: wget -q ${DOWNLOAD_URL} -O foundry.tar.gz
#env:
# DOWNLOAD_URL: ${{ steps.get-latest-foundry-release.outputs.result }}
- name: Untar the release
run: tar zxf foundry.tar.gz
- name: Add Foundry to path
Expand Down

0 comments on commit ba6f778

Please sign in to comment.