Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test CI for publishing builtin plugins #1649

Draft
wants to merge 12 commits into
base: zdobnikau/publish-builtin-plugins-ci
Choose a base branch
from
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:
merge_group:

jobs:
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/publish_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
release:
types:
- published
pull_request:

jobs:
publish:
Expand All @@ -16,7 +17,7 @@ jobs:

- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ github.ref_name }}
scarb-version: nightly-2024-10-15

- name: Init Scarb to cache plugins
id: scarb-init
Expand All @@ -33,31 +34,31 @@ jobs:
id: check-plugins
run: |
set -eo pipefail
echo "assert_macros_exists=$(curl -s https://scarbs.xyz/api/v1/index/as/se/assert_macros.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "cairo_run_exists=$(curl -s https://scarbs.xyz/api/v1/index/ca/ir/cairo_run.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "starknet_exists=$(curl -s https://scarbs.xyz/api/v1/index/st/ar/starknet.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "cairo_test_exists=$(curl -s https://scarbs.xyz/api/v1/index/ca/ir/cairo_test.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "assert_macros_exists=$(curl -s https://scarbs.dev/api/v1/index/as/se/assert_macros.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "cairo_run_exists=$(curl -s https://scarbs.dev/api/v1/index/ca/ir/cairo_run.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "starknet_exists=$(curl -s https://scarbs.dev/api/v1/index/st/ar/starknet.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT
echo "cairo_test_exists=$(curl -s https://scarbs.dev/api/v1/index/ca/ir/cairo_test.json | jq --arg version "${{ steps.scarb-init.outputs.CAIRO_VERSION }}" '[.[] | select(.v == $version)] | length > 0')" >> $GITHUB_OUTPUT

- name: Publish starknet
if: steps.check-plugins.outputs.starknet_exists != 'true'
run: |
pushd $HOME/.cache/scarb/registry/std/v${{ steps.scarb-init.outputs.CAIRO_VERSION }}/starknet
scarb publish --no-verify
pushd $HOME/.cache/scarb/registry/std/7a2cdc90b/starknet
scarb publish --index https://scarbs.dev --no-verify

- name: Publish cairo_run
if: steps.check-plugins.outputs.cairo_run_exists != 'true'
run: |
pushd $HOME/.cache/scarb/registry/std/v${{ steps.scarb-init.outputs.CAIRO_VERSION }}/cairo_run
scarb publish --no-verify
pushd $HOME/.cache/scarb/registry/std/7a2cdc90b/cairo_run
scarb publish --index https://scarbs.dev --no-verify

- name: Publish cairo_test
if: steps.check-plugins.outputs.cairo_test_exists != 'true'
run: |
pushd $HOME/.cache/scarb/registry/std/v${{ steps.scarb-init.outputs.CAIRO_VERSION }}/test_plugin
scarb publish --no-verify
pushd $HOME/.cache/scarb/registry/std/7a2cdc90b/test_plugin
scarb publish --index https://scarbs.dev --no-verify

- name: Publish assert_macros
if: steps.check-plugins.outputs.assert_macros_exists != 'true'
run: |
pushd $HOME/.cache/scarb/registry/std/v${{ steps.scarb-init.outputs.CAIRO_VERSION }}/assert_macros
scarb publish --no-verify
pushd $HOME/.cache/scarb/registry/std/7a2cdc90b/assert_macros
scarb publish --index https://scarbs.dev --no-verify
Loading