mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Use the new publish crate tool
This commit is contained in:
parent
0fea113fa2
commit
375c878849
44
.github/scripts/publish-crate.sh
vendored
44
.github/scripts/publish-crate.sh
vendored
|
@ -1,44 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e # Fail if any command fails
|
|
||||||
|
|
||||||
function wait_for_release() {
|
|
||||||
local package="$1"
|
|
||||||
local package_with_underscores="${package/-/_}"
|
|
||||||
|
|
||||||
local first_two_characters="${package_with_underscores:0:2}"
|
|
||||||
local second_two_characters="${package_with_underscores:2:2}"
|
|
||||||
|
|
||||||
local path="$first_two_characters/$second_two_characters"
|
|
||||||
|
|
||||||
if [ "$package" == "agb" ]; then
|
|
||||||
path="3/a"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local url_to_poll="https://raw.githubusercontent.com/rust-lang/crates.io-index/master/$path/$package_with_underscores"
|
|
||||||
|
|
||||||
local expected_version
|
|
||||||
expected_version=$(grep -E '^version' Cargo.toml | grep -oE '[0-9.]+')
|
|
||||||
|
|
||||||
local attempts=1
|
|
||||||
|
|
||||||
while [ $attempts -le 15 ]; do
|
|
||||||
echo "Polling crates.io with URL $url_to_poll to see if the version has updated (attempt $attempts)"
|
|
||||||
if curl "$url_to_poll" | grep "$expected_version"; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 30s
|
|
||||||
attempts=$((attempts + 1))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
PROJECTS_TO_RELEASE_IN_ORDER="agb-macros agb-fixnum agb-image-converter agb-sound-converter agb"
|
|
||||||
|
|
||||||
for PROJECT in $PROJECTS_TO_RELEASE_IN_ORDER; do
|
|
||||||
pushd "$PROJECT"
|
|
||||||
echo "Publishing $PROJECT"
|
|
||||||
cargo publish
|
|
||||||
wait_for_release "$PROJECT"
|
|
||||||
popd
|
|
||||||
done
|
|
5
.github/workflows/publish-agb.yml
vendored
5
.github/workflows/publish-agb.yml
vendored
|
@ -19,8 +19,10 @@ jobs:
|
||||||
- name: Login to crates.io
|
- name: Login to crates.io
|
||||||
run: cargo login ${{ secrets.CRATE_API }}
|
run: cargo login ${{ secrets.CRATE_API }}
|
||||||
|
|
||||||
|
- uses: extractions/setup-just@v1
|
||||||
|
|
||||||
- name: Publish crates
|
- name: Publish crates
|
||||||
run: bash .github/scripts/publish-crate.sh
|
run: just publish
|
||||||
|
|
||||||
- name: Update template repo
|
- name: Update template repo
|
||||||
env:
|
env:
|
||||||
|
@ -30,7 +32,6 @@ jobs:
|
||||||
|
|
||||||
- name: Install gbafix
|
- name: Install gbafix
|
||||||
run: cargo install gbafix
|
run: cargo install gbafix
|
||||||
- uses: extractions/setup-just@v1
|
|
||||||
- name: Build the examples
|
- name: Build the examples
|
||||||
run: just build-roms
|
run: just build-roms
|
||||||
- name: Upload examples to the release
|
- name: Upload examples to the release
|
||||||
|
|
5
justfile
5
justfile
|
@ -64,6 +64,11 @@ update-linker-scripts:
|
||||||
find -type f -name gba.ld | grep -v ./agb/gba.ld | xargs -n1 cp -v -- agb/gba.ld
|
find -type f -name gba.ld | grep -v ./agb/gba.ld | xargs -n1 cp -v -- agb/gba.ld
|
||||||
find -type f -name gba_mb.ld | grep -v ./agb/gba_mb.ld | xargs -n1 cp -v -- agb/gba_mb.ld
|
find -type f -name gba_mb.ld | grep -v ./agb/gba_mb.ld | xargs -n1 cp -v -- agb/gba_mb.ld
|
||||||
|
|
||||||
|
publish: (_run-tool "publish")
|
||||||
|
|
||||||
|
_run-tool +tool:
|
||||||
|
cargo run --manifest-path "{{justfile_directory() + "/tools/Cargo.toml"}}" -- {{tool}}
|
||||||
|
|
||||||
_build-rom folder name:
|
_build-rom folder name:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
Loading…
Reference in a new issue