Skip to content

Commit cf5fcb2

Browse files
committed
Bump deps, use scarb in nightly
commit-id:fa08970b
1 parent 7bb7b2a commit cf5fcb2

File tree

23 files changed

+263
-185
lines changed

23 files changed

+263
-185
lines changed

.github/workflows/_build-plugin-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
112112
PACKAGE_NAME=${{ inputs.plugin_name }}
113113
PACKAGE_NAME=${PACKAGE_NAME//-/_} # Replace `-` with `_` in name
114-
PACKAGE_VERSION=$(get_version "${{ inputs.overridden_plugin_version }}")
114+
PACKAGE_VERSION=$(get_version "${{ inputs.overridden_plugin_version }}" "crates/${{ inputs.plugin_name }}/Scarb.toml")
115115
116116
TARGET="${{ matrix.target }}"
117117
EXT="${{ matrix.ext }}"

.github/workflows/_publish-plugin.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
plugin_name_underscores=${{ inputs.plugin_name }}
3333
plugin_name_underscores=${plugin_name_underscores//-/_}
34-
plugin_version=$(get_version "${{ inputs.overridden_plugin_version }}")
34+
plugin_version=$(get_version "${{ inputs.overridden_plugin_version }}" "crates/${{ inputs.plugin_name }}/Scarb.toml")
3535
3636
registry_url=${{ inputs.prod_registry == true && 'https://scarbs.xyz' || 'https://scarbs.dev' }}
3737
plugin_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/fo/${plugin_name_underscores}.json | jq --arg version "$plugin_version" '[.[] | select(.v == $version)] | length > 0')
@@ -78,7 +78,7 @@ jobs:
7878
fi
7979
8080
- name: Publish ${{ inputs.plugin_name }}
81-
if: needs.check-uploaded.outputs.plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch'
81+
if: needs.check-uploaded.outputs.plugin_uploaded == 'false'
8282
working-directory: crates/${{ inputs.plugin_name }}
8383
run: |
8484
set -exo pipefail
@@ -87,4 +87,4 @@ jobs:
8787
update_version_in_file "Scarb.toml" "${{ inputs.overridden_plugin_version }}"
8888
update_version_in_file "Cargo.toml" "${{ inputs.overridden_plugin_version }}"
8989
90-
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}
90+
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }} ${{ inputs.overridden_plugin_version == 'snforge-scarb-plugin-deprecated' && '--ignore-cairo-version' || ' ' }}

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::requirements::test_warning_on_scarb_version_below_recommended
148148
- run: cargo test --package forge --features scarb_2_9_1 --lib compatibility_check::tests::warning_requirements
149149
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::running::sierra_gas_with_older_scarb
150-
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::new::init_new_project_from_scarb_with_snforge_std_compatibility
150+
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::new::init_new_project_from_scarb_with_snforge_std_deprecated
151151

152152
# TODO(#3212): Closures in Cairo are fully supported since version 2.11
153153
test-interact-with-state:
@@ -219,8 +219,8 @@ jobs:
219219
working-directory: crates/snforge-scarb-plugin
220220
run: cargo test --release
221221

222-
test-forge-scarb-plugin-compatibility:
223-
name: Test Forge Scarb Plugin Compatibility
222+
test-forge-scarb-plugin-deprecated:
223+
name: Test Forge Scarb Plugin Deprecated
224224
runs-on: ubuntu-latest
225225
steps:
226226
- uses: actions/checkout@v4
@@ -229,7 +229,7 @@ jobs:
229229
- uses: software-mansion/setup-scarb@v1
230230
- uses: software-mansion/setup-universal-sierra-compiler@v1
231231
- name: Run Forge Scarb Plugin tests
232-
working-directory: crates/snforge-scarb-plugin-compatibility
232+
working-directory: crates/snforge-scarb-plugin-deprecated
233233
run: cargo test --release
234234

235235
test-cast:
@@ -287,7 +287,7 @@ jobs:
287287
- uses: software-mansion/setup-scarb@v1
288288
- name: Check cairo files format
289289
run: |
290-
output=$(find . -type f -name "Scarb.toml" -not -path "*/snforge_std_compatibility/*" -execdir sh -c '
290+
output=$(find . -type f -name "Scarb.toml" -not -path "*/snforge_std_deprecated/*" -execdir sh -c '
291291
echo "Running \"scarb fmt\" in directory: $PWD"
292292
scarb fmt --check
293293
' \;)

.github/workflows/nightly.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
echo "nightly_version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT
4949
echo "nightly_branch=$NIGHTLY_BRANCH" >> $GITHUB_OUTPUT
5050
51+
- uses: software-mansion/setup-scarb@v1
52+
5153
- name: Update metadata before release
5254
run: ./scripts/release.sh ${{ env.NIGHTLY_VERSION }}
5355

@@ -84,16 +86,16 @@ jobs:
8486
ref: ${{ needs.prepare.outputs.nightly_branch }}
8587
plugin_name: "snforge-scarb-plugin"
8688

87-
build-compatibility-plugin-binaries:
88-
# This job is not necessary for nightly releases, but we still publish compatibility plugin for
89+
build-deprecated-plugin-binaries:
90+
# This job is not necessary for nightly releases, but we still publish deprecated plugin for
8991
# the sake of consistency with the normal release workflow.
90-
name: Build compatibility plugin binaries
92+
name: Build deprecated plugin binaries
9193
needs: prepare
9294
uses: ./.github/workflows/_build-plugin-binaries.yml
9395
with:
9496
overridden_plugin_version: ${{ needs.prepare.outputs.nightly_version }}
9597
ref: ${{ needs.prepare.outputs.nightly_branch }}
96-
plugin_name: "snforge-scarb-plugin-compatibility"
98+
plugin_name: "snforge-scarb-plugin-deprecated"
9799

98100
publish-plugin:
99101
needs: [ prepare, build-plugin-binaries ]
@@ -105,20 +107,20 @@ jobs:
105107
plugin_name: "snforge-scarb-plugin"
106108

107109

108-
publish-compatibility-plugin:
109-
# This job is not necessary for nightly releases, but we still publish compatibility plugin for
110+
publish-deprecated-plugin:
111+
# This job is not necessary for nightly releases, but we still publish deprecated plugin for
110112
# the sake of consistency with the normal release workflow.
111-
needs: [ prepare, build-compatibility-plugin-binaries ]
113+
needs: [ prepare, build-deprecated-plugin-binaries ]
112114
uses: ./.github/workflows/_publish-plugin.yml
113115
secrets: inherit
114116
with:
115117
prod_registry: false
116118
overridden_plugin_version: ${{ needs.prepare.outputs.nightly_version }}
117-
plugin_name: "snforge-scarb-plugin-compatibility"
119+
plugin_name: "snforge-scarb-plugin-deprecated"
118120

119121

120122
publish-std:
121-
needs: [ prepare, publish-plugin, publish-compatibility-plugin ]
123+
needs: [ prepare, publish-plugin, publish-deprecated-plugin ]
122124
uses: ./.github/workflows/publish-std.yml
123125
secrets: inherit
124126
with:
@@ -128,7 +130,7 @@ jobs:
128130

129131
test-binary:
130132
name: Test binary
131-
needs: [ prepare, build-binaries, build-plugin-binaries, publish-plugin, publish-compatibility-plugin, publish-std ]
133+
needs: [ prepare, build-binaries, build-plugin-binaries, publish-plugin, publish-deprecated-plugin, publish-std ]
132134
uses: ./.github/workflows/_test-binaries.yml
133135
secrets: inherit
134136
with:

.github/workflows/publish-std.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,39 @@ on:
3131
type: string
3232

3333
jobs:
34+
check-uploaded:
35+
name: Check stds uploaded
36+
runs-on: ubuntu-latest
37+
outputs:
38+
snforge_std_uploaded: ${{ steps.check-uploaded.outputs.snforge_std_uploaded }}
39+
snforge_std_deprecated_uploaded: ${{ steps.check-uploaded.outputs.snforge_std_deprecated_uploaded }}
40+
sncast_std_uploaded: ${{ steps.check-uploaded.outputs.sncast_std_uploaded }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Check version
44+
id: check-uploaded
45+
run: |
46+
set -exo pipefail
47+
48+
source scripts/handle_version.sh
49+
50+
snforge_std_version=$(get_version "${{ inputs.override_std_version }}" "snforge_std")
51+
snforge_std_deprecated_version=$(get_version "${{ inputs.override_std_version }}" "snforge_std_compatibilty")
52+
sncast_std_version=$(get_version "${{ inputs.override_std_version }}" "sncast_std")
53+
54+
registry_url=${{ inputs.prod_registry == true && 'https://scarbs.xyz' || 'https://scarbs.dev' }}
55+
56+
snforge_std_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/fo/snforge_std.json | jq --arg version "$snforge_std_version" '[.[] | select(.v == $version)] | length > 0')
57+
snforge_std_deprecated_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/fo/snforge_std_deprecated.json | jq --arg version "$snforge_std_deprecated_version" '[.[] | select(.v == $version)] | length > 0')
58+
sncast_std_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/ca/sncast_std.json | jq --arg version "$sncast_std_version" '[.[] | select(.v == $version)] | length > 0')
59+
60+
echo "snforge_std_uploaded=$snforge_std_uploaded" >> $GITHUB_OUTPUT
61+
echo "snforge_std_deprecated_uploaded=$snforge_std_deprecated_uploaded" >> $GITHUB_OUTPUT
62+
echo "sncast_std_uploaded=$sncast_std_uploaded" >> $GITHUB_OUTPUT
3463
publish-to-registry:
3564
name: Publish packages to the registry
3665
runs-on: ubuntu-latest
66+
needs: [ check-uploaded ]
3767
env:
3868
SCARB_REGISTRY_AUTH_TOKEN: ${{ inputs.prod_registry == true && secrets.SCARB_REGISTRY_AUTH_TOKEN || secrets.DEV_SCARB_REGISTRY_AUTH_TOKEN }}
3969
steps:
@@ -46,6 +76,7 @@ jobs:
4676
- uses: software-mansion/setup-scarb@v1
4777

4878
- name: Publish sncast_std
79+
if: needs.check-uploaded.outputs.sncast_std_uploaded == 'false'
4980
working-directory: sncast_std
5081
run: |
5182
source ../scripts/handle_version.sh
@@ -55,6 +86,7 @@ jobs:
5586
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}
5687
5788
- name: Publish snforge_std
89+
if: needs.check-uploaded.outputs.snforge_std_uploaded == 'false'
5890
working-directory: snforge_std
5991
run: |
6092
source ../scripts/handle_version.sh
@@ -70,18 +102,19 @@ jobs:
70102
71103
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}
72104
73-
- name: Publish snforge_std_compatibility
74-
working-directory: snforge_std_compatibility
105+
- name: Publish snforge_std_deprecated
106+
if: needs.check-uploaded.outputs.snforge_std_deprecated_uploaded == 'false'
107+
working-directory: snforge_std_deprecated
75108
run: |
76109
source ../scripts/handle_version.sh
77110
78111
update_version_in_file "Scarb.toml" "${{ inputs.override_std_version }}"
79112
80113
if ${{ inputs.prod_registry == true }}; then
81-
scarb add snforge_scarb_plugin_compatibility@${{ inputs.plugin_dep_version }}
114+
scarb add snforge_scarb_plugin_deprecated@${{ inputs.plugin_dep_version }}
82115
else
83-
sed -i.bak "/snforge_scarb_plugin_compatibility/ s/\(snforge_scarb_plugin_compatibility = \).*/\1{ version = \"=${{ inputs.plugin_dep_version }}\", registry = \"https:\/\/scarbs.dev\/\" }/" Scarb.toml
116+
sed -i.bak "/snforge_scarb_plugin_deprecated/ s/\(snforge_scarb_plugin_deprecated = \).*/\1{ version = \"=${{ inputs.plugin_dep_version }}\", registry = \"https:\/\/scarbs.dev\/\" }/" Scarb.toml
84117
rm Scarb.toml.bak 2>/dev/null
85118
fi
86119
87-
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}
120+
scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }} --ignore-cairo-version

.github/workflows/release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ jobs:
7272
with:
7373
plugin_name: "snforge-scarb-plugin"
7474

75-
build-compatibility-plugin-binaries:
76-
name: Build compatibility plugin binaries
75+
build-deprecated-plugin-binaries:
76+
name: Build deprecated plugin binaries
7777
if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}
7878
needs: verify-version
7979
uses: ./.github/workflows/_build-plugin-binaries.yml
8080
with:
81-
plugin_name: "snforge-scarb-plugin-compatibility"
81+
plugin_name: "snforge-scarb-plugin-deprecated"
8282

8383
dev-publish-plugin:
8484
needs: [verify-version, build-plugin-binaries]
@@ -89,17 +89,17 @@ jobs:
8989
overridden_plugin_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}
9090
plugin_name: "snforge-scarb-plugin"
9191

92-
dev-publish-compatibility-plugin:
93-
needs: [ verify-version, build-compatibility-plugin-binaries ]
92+
dev-publish-deprecated-plugin:
93+
needs: [ verify-version, build-deprecated-plugin-binaries ]
9494
if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}
9595
uses: ./.github/workflows/_publish-plugin.yml
9696
secrets: inherit
9797
with:
9898
overridden_plugin_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}
99-
plugin_name: "snforge-scarb-plugin-compatibility"
99+
plugin_name: "snforge-scarb-plugin-deprecated"
100100

101101
dev-publish-std:
102-
needs: [verify-version, dev-publish-plugin, dev-publish-compatibility-plugin]
102+
needs: [verify-version, dev-publish-plugin, dev-publish-deprecated-plugin]
103103
if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}
104104
uses: ./.github/workflows/publish-std.yml
105105
secrets: inherit
@@ -109,7 +109,7 @@ jobs:
109109

110110
test-binary:
111111
name: Test binary
112-
needs: [build-binaries, verify-version, dev-publish-std, dev-publish-plugin, dev-publish-compatibility-plugin]
112+
needs: [build-binaries, verify-version, dev-publish-std, dev-publish-plugin, dev-publish-deprecated-plugin]
113113
uses: ./.github/workflows/_test-binaries.yml
114114
secrets: inherit
115115
with:
@@ -160,18 +160,18 @@ jobs:
160160
prod_registry: true
161161
plugin_name: "snforge-scarb-plugin"
162162

163-
publish-snforge-scarb-plugin-compatibility:
164-
name: Publish snforge_scarb_plugin_compatibility
163+
publish-snforge-scarb-plugin-deprecated:
164+
name: Publish snforge_scarb_plugin_deprecated
165165
needs: [ test-binary, create-release ]
166166
uses: ./.github/workflows/_publish-plugin.yml
167167
secrets: inherit
168168
with:
169169
prod_registry: true
170-
plugin_name: "snforge-scarb-plugin-compatibility"
170+
plugin_name: "snforge-scarb-plugin-deprecated"
171171

172172
publish-to-registry:
173173
name: Publish packages to the registry
174-
needs: [ verify-version, publish-snforge-scarb-plugin, publish-snforge-scarb-plugin-compatibility ]
174+
needs: [ verify-version, publish-snforge-scarb-plugin, publish-snforge-scarb-plugin-deprecated ]
175175
uses: ./.github/workflows/publish-std.yml
176176
secrets: inherit
177177
with:

.github/workflows/scheduled.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
uses: mikefarah/yq@8bf425b4d1344db7cd469a8d10a390876e0c77fd
138138
with:
139139
cmd: yq -oy '.workspace.package.version' 'Cargo.toml'
140-
140+
141141
- name: Return version
142142
id: validVersion
143143
run: |
@@ -154,39 +154,39 @@ jobs:
154154
plugin_name: 'snforge-scarb-plugin'
155155

156156
publish-plugin:
157-
needs: [get-version, build-plugin-binaries]
157+
needs: [ get-version, build-plugin-binaries ]
158158
uses: ./.github/workflows/_publish-plugin.yml
159159
secrets: inherit
160160
with:
161161
overridden_plugin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}
162162
plugin_name: 'snforge-scarb-plugin'
163163

164-
build-compatibility-plugin-binaries:
165-
name: Build compatibility plugin binaries
164+
build-deprecated-plugin-binaries:
165+
name: Build deprecated plugin binaries
166166
needs: get-version
167167
uses: ./.github/workflows/_build-plugin-binaries.yml
168168
with:
169169
overridden_plugin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}
170-
plugin_name: 'snforge-scarb-plugin-compatibility'
170+
plugin_name: 'snforge-scarb-plugin-deprecated'
171171

172-
publish-compatibility-plugin:
173-
needs: [get-version, build-compatibility-plugin-binaries]
172+
publish-deprecated-plugin:
173+
needs: [ get-version, build-deprecated-plugin-binaries ]
174174
uses: ./.github/workflows/_publish-plugin.yml
175175
secrets: inherit
176176
with:
177177
overridden_plugin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}
178-
plugin_name: 'snforge-scarb-plugin-compatibility'
178+
plugin_name: 'snforge-scarb-plugin-deprecated'
179179

180180
publish-std:
181-
needs: [get-version, publish-plugin, publish-compatibility-plugin]
181+
needs: [ get-version, publish-plugin, publish-deprecated-plugin ]
182182
uses: ./.github/workflows/publish-std.yml
183183
secrets: inherit
184184
with:
185185
plugin_dep_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}
186186
override_std_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}
187187

188188
build-binaries:
189-
needs: [get-version]
189+
needs: [ get-version ]
190190
uses: ./.github/workflows/_build-binaries.yml
191191
with:
192192
version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}

0 commit comments

Comments
 (0)