Test CI for publishing builtin plugins #3
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
name: Publish Built-in Plugins | |
on: | |
release: | |
types: | |
- published | |
pull_request: | |
jobs: | |
publish: | |
name: Publish plugins | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: software-mansion/setup-scarb@v1 | |
with: | |
scarb-version: nightly-2024-10-15 | |
- name: Init Scarb to cache plugins | |
id: scarb-init | |
run: | | |
set -eo pipefail | |
mkdir -p $HOME/pkg | |
pushd $HOME/pkg | |
scarb init --no-vcs | |
echo "CAIRO_VERSION=$(scarb metadata --format-version 1 | jq -r '.app_version_info.cairo.version')" >> $GITHUB_OUTPUT | |
popd | |
env: | |
SCARB_INIT_TEST_RUNNER: cairo-test | |
- name: Publish plugins from cache | |
run: | | |
set -eo pipefail | |
pushd $HOME/.cache/scarb/registry/std/v${{ steps.scarb-init.outputs.CAIRO_VERSION }} | |
for package_dir in *; do | |
if [ -d "$package_dir" ] && [ "$package_dir" != "core" ]; then | |
pushd "$package_dir" | |
scarb publish --index https://scarbs.dev --no-verify | |
popd | |
fi | |
done | |
env: | |
SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} |