From 0fd752dd790b98beb2f073a679b2aad90dd8b11f Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:12:28 +0200 Subject: [PATCH 01/66] Trigger release on push, compare versions from toml and latest release --- .github/workflows/release.yml | 22 +++++++++--- .gitignore | 1 + scripts/compareVersions.js | 14 ++++++++ scripts/package-lock.json | 65 +++++++++++++++++++++++++++++++++++ scripts/package.json | 5 +++ 5 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 scripts/compareVersions.js create mode 100644 scripts/package-lock.json create mode 100644 scripts/package.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0e6785384..a6bba1e4e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,8 @@ name: Release on: push: - tags: - - v[0-9]+.* +# tags: +# - v[0-9]+.* permissions: contents: write @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 - name: Get version from Cargo.toml id: lookupVersion @@ -20,9 +21,20 @@ jobs: with: cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' - - name: Version check - if: steps.lookupVersion.outputs.result != github.ref_name - run: echo "Project version in Cargo.toml does not match the tag" && exit 1 + - name: Get version from the latest releases + id: lookupVersionRelease + uses: pozetroninc/github-action-get-latest-release@master + with: + owner: cptartur + repo: starknet-foundry + excludes: prerelease, draft + + - name: Compare versions + run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.result }} + +# - name: Version check +# if: steps.lookupVersion.outputs.result != github.ref_name +# run: echo "Project version in Cargo.toml does not match the tag" && exit 1 build-binaries: name: Build ${{ matrix.target }} diff --git a/.gitignore b/.gitignore index 3ebf85c66c..2ad2ce1c83 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ pyproject.toml target .vscode/ .env +*/node_modules \ No newline at end of file diff --git a/scripts/compareVersions.js b/scripts/compareVersions.js new file mode 100644 index 0000000000..45db2780f5 --- /dev/null +++ b/scripts/compareVersions.js @@ -0,0 +1,14 @@ +const semver = require('semver') + +if (process.argv.length !== 4) { + console.error('Two arguments requred'); + process.exit(1); +} + +const old_version = process.argv[2]; +const new_version = process.argv[3]; + +if (!semver.gt(new_version, old_version)) { + console.error('Version is not greater than previous release'); + process.exit(2); +} diff --git a/scripts/package-lock.json b/scripts/package-lock.json new file mode 100644 index 0000000000..b23d9a19df --- /dev/null +++ b/scripts/package-lock.json @@ -0,0 +1,65 @@ +{ + "name": "scripts", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "semver": "^7.5.4" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000000..f18e7c9d59 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "semver": "^7.5.4" + } +} From cac45856a14b4c1f089ac32c4c8b7c78cfc550b3 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:24:54 +0200 Subject: [PATCH 02/66] Use correct output name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6bba1e4e6..19d907d29c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: excludes: prerelease, draft - name: Compare versions - run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.result }} + run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.release }} # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name From e8e0ec22d19e3614e26bb3f87c119e044ba6ec5a Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:27:46 +0200 Subject: [PATCH 03/66] Set dependencies in setup node --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19d907d29c..51a120e005 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 + with: + cache: 'npm' + cache-dependency-path: 'scripts/package-lock.json' - name: Get version from Cargo.toml id: lookupVersion From fbbfca132bea70e83249aeffe3d5328fbaee1c22 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:29:32 +0200 Subject: [PATCH 04/66] Run `npm ci` --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51a120e005..4ae92d0d55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: cache: 'npm' cache-dependency-path: 'scripts/package-lock.json' + - run: npm ci - name: Get version from Cargo.toml id: lookupVersion @@ -35,9 +37,9 @@ jobs: - name: Compare versions run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.release }} -# - name: Version check -# if: steps.lookupVersion.outputs.result != github.ref_name -# run: echo "Project version in Cargo.toml does not match the tag" && exit 1 + # - name: Version check + # if: steps.lookupVersion.outputs.result != github.ref_name + # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 build-binaries: name: Build ${{ matrix.target }} From 3e41bc4328efca060955fa781d80e44ed317745e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:30:58 +0200 Subject: [PATCH 05/66] Add working directory --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ae92d0d55..23fa8fed61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ jobs: cache: 'npm' cache-dependency-path: 'scripts/package-lock.json' - run: npm ci + working-directory: scripts - name: Get version from Cargo.toml id: lookupVersion From f801f4a71630b22211be98c5d5e42d055084a1a2 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:31:05 +0200 Subject: [PATCH 06/66] Remove unnecessary quotes --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23fa8fed61..cfe668207c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-node@v3 with: cache: 'npm' - cache-dependency-path: 'scripts/package-lock.json' + cache-dependency-path: scripts/package-lock.json - run: npm ci working-directory: scripts From d7a365666f7a3182175a47407d768c00e2da86af Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:40:22 +0200 Subject: [PATCH 07/66] Echo values --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfe668207c..59a28e6a07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,9 @@ jobs: repo: starknet-foundry excludes: prerelease, draft + - run: echo {{ steps.lookupVersion.outputs.result }} + - run: echo {{ steps.lookupVersionRelease.outputs.release }} + - name: Compare versions run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.release }} From acb5586fc8a1e111f2e079d28486e279173348ba Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:41:50 +0200 Subject: [PATCH 08/66] Use correct expression syntax --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59a28e6a07..f11c6b0cc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,11 +35,11 @@ jobs: repo: starknet-foundry excludes: prerelease, draft - - run: echo {{ steps.lookupVersion.outputs.result }} - - run: echo {{ steps.lookupVersionRelease.outputs.release }} + - run: echo ${{ steps.lookupVersion.outputs.result }} + - run: echo ${{ steps.lookupVersionRelease.outputs.release }} - name: Compare versions - run: node ./scripts/compareVersions.js {{ steps.lookupVersion.outputs.result }} {{ steps.lookupVersionRelease.outputs.release }} + run: node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }} # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name From b635ec32ccf4730f5d2c95625f9af6ab9b4d819e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 10:49:17 +0200 Subject: [PATCH 09/66] Add graceful shutdown --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f11c6b0cc8..d661357de8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,10 @@ jobs: - name: Compare versions run: node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }} + - name: Stop execution on not greater version + if: ${{ failure() }} + run: echo "Not releasing" + # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 From ad24ce5259ea1510f52b3fac5541986970350c68 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:42:38 +0200 Subject: [PATCH 10/66] Output true false --- .github/workflows/release.yml | 10 +++++----- scripts/compareVersions.js | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d661357de8..1b7157b7f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,11 +39,10 @@ jobs: - run: echo ${{ steps.lookupVersionRelease.outputs.release }} - name: Compare versions - run: node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }} - - - name: Stop execution on not greater version - if: ${{ failure() }} - run: echo "Not releasing" + id: validVersion + run: | + VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }}) + echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name @@ -51,6 +50,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} + if: steps.validVersion.outputs.VALID_VERSION == "true" needs: verify-version runs-on: ${{ matrix.os }} continue-on-error: true diff --git a/scripts/compareVersions.js b/scripts/compareVersions.js index 45db2780f5..f35f157a2f 100644 --- a/scripts/compareVersions.js +++ b/scripts/compareVersions.js @@ -8,7 +8,8 @@ if (process.argv.length !== 4) { const old_version = process.argv[2]; const new_version = process.argv[3]; -if (!semver.gt(new_version, old_version)) { - console.error('Version is not greater than previous release'); - process.exit(2); -} +// if (!semver.gt(new_version, old_version)) { +// console.error('Version is not greater than previous release'); +// process.exit(2); +// } +console.log((semver.gt(new_version, old_version)).toString()) From f16d99d5b0b589a82db88a7df46b4e15ba4bb9c2 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:45:23 +0200 Subject: [PATCH 11/66] Use job output --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b7157b7f3..591ff2f533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} - if: steps.validVersion.outputs.VALID_VERSION == "true" + if: verify-version.outputs.VALID_VERSION == "true" needs: verify-version runs-on: ${{ matrix.os }} continue-on-error: true From 3e4e214dc35e45132e68079bdd777b59a33350ba Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:46:57 +0200 Subject: [PATCH 12/66] Use expression syntax --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 591ff2f533..fc3e172964 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} - if: verify-version.outputs.VALID_VERSION == "true" + if: ${{ verify-version.outputs.VALID_VERSION == "true" }} needs: verify-version runs-on: ${{ matrix.os }} continue-on-error: true From 486a01190310d4ef9493725fb67ebea9aabdc123 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:48:07 +0200 Subject: [PATCH 13/66] Use `needs` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc3e172964..cc22bbcd8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,8 +50,8 @@ jobs: build-binaries: name: Build ${{ matrix.target }} - if: ${{ verify-version.outputs.VALID_VERSION == "true" }} needs: verify-version + if: ${{ needs.verify-version.outputs.VALID_VERSION == "true" }} runs-on: ${{ matrix.os }} continue-on-error: true From d7cd0edf6f3030575cf3acdffc3864abd4b58549 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:49:03 +0200 Subject: [PATCH 14/66] Use single quotes --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc22bbcd8a..535f79d9ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} needs: verify-version - if: ${{ needs.verify-version.outputs.VALID_VERSION == "true" }} + if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} runs-on: ${{ matrix.os }} continue-on-error: true From 2c2ee3534f37fc8aaf9d9b063297c62f5b22bc76 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:51:31 +0200 Subject: [PATCH 15/66] Bump version --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28c29d4ee8..0fdde596c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index a9836c23f9..5dfcf06e89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.3" +version = "0.8.4" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From e41e6bd387dae74b3ed739bad44af24d17f26385 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:54:58 +0200 Subject: [PATCH 16/66] Echo steps output --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 535f79d9ed..dd1a246419 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,8 @@ jobs: VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }}) echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT + - run: echo ${{ steps.outputs.VALID_VERSION }} + # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 From 4e9ee7a7f57f1654c2647420e88bce93b050bbad Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:56:34 +0200 Subject: [PATCH 17/66] Echo steps output --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd1a246419..02e53e11a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,7 @@ jobs: id: validVersion run: | VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }}) + echo $VALID_VERSION echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT - run: echo ${{ steps.outputs.VALID_VERSION }} From 2112d9a74b13a5ec1e024fe3cbb28f8115f11add Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:57:42 +0200 Subject: [PATCH 18/66] Fix arguments order --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02e53e11a9..6e4367a358 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,12 +41,9 @@ jobs: - name: Compare versions id: validVersion run: | - VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersion.outputs.result }} ${{ steps.lookupVersionRelease.outputs.release }}) - echo $VALID_VERSION + VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.result }} ${{ steps.lookupVersion.outputs.release }}) echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT - - run: echo ${{ steps.outputs.VALID_VERSION }} - # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 From 6c04152a5fbe27da7524636965d7c7f63aad3e06 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:57:49 +0200 Subject: [PATCH 19/66] Remove echos --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e4367a358..e4be01397d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,6 @@ jobs: repo: starknet-foundry excludes: prerelease, draft - - run: echo ${{ steps.lookupVersion.outputs.result }} - - run: echo ${{ steps.lookupVersionRelease.outputs.release }} - - name: Compare versions id: validVersion run: | From 5549170012b12e3d5f2e5096c27432e2434655bc Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 15:59:38 +0200 Subject: [PATCH 20/66] Use correct argument names --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4be01397d..4940e0764c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: - name: Compare versions id: validVersion run: | - VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.result }} ${{ steps.lookupVersion.outputs.release }}) + VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT # - name: Version check From 183c3851d4ab871a419a5e30bb9108aaadf6473a Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:00:57 +0200 Subject: [PATCH 21/66] Echo version --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4940e0764c..5686e345d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,7 @@ jobs: id: validVersion run: | VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) + echo "VALID_VERSION=$VALID_VERSION" echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT # - name: Version check From 1626a837e3295a52558bf473443010af0245696e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:04:36 +0200 Subject: [PATCH 22/66] Echo version --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5686e345d3..26438b52aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,8 +39,7 @@ jobs: id: validVersion run: | VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) - echo "VALID_VERSION=$VALID_VERSION" - echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT + echo "VALID_VERSION=$VALID_VERSION" >> "$GITHUB_OUTPUT" # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name @@ -49,7 +48,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} needs: verify-version - if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} +# if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} runs-on: ${{ matrix.os }} continue-on-error: true @@ -87,6 +86,9 @@ jobs: os: windows-latest steps: + - run: ${{ needs.verify-version.outputs.VALID_VERSION }} + - run: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} + - uses: actions/checkout@v4 with: submodules: true From ef0ae9afbfc3f536736878a70534bc1135b8fffa Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:06:22 +0200 Subject: [PATCH 23/66] Revert "Echo version" This reverts commit 1626a837e3295a52558bf473443010af0245696e. --- .github/workflows/release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26438b52aa..5686e345d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,8 @@ jobs: id: validVersion run: | VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) - echo "VALID_VERSION=$VALID_VERSION" >> "$GITHUB_OUTPUT" + echo "VALID_VERSION=$VALID_VERSION" + echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name @@ -48,7 +49,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} needs: verify-version -# if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} + if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} runs-on: ${{ matrix.os }} continue-on-error: true @@ -86,9 +87,6 @@ jobs: os: windows-latest steps: - - run: ${{ needs.verify-version.outputs.VALID_VERSION }} - - run: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} - - uses: actions/checkout@v4 with: submodules: true From ab56afcaac79ad6dc4543bcbc5984704f7d031ef Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:07:37 +0200 Subject: [PATCH 24/66] Define outputs correctly --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5686e345d3..dcaaf094b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,8 @@ permissions: jobs: verify-version: runs-on: ubuntu-latest + outputs: + versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} steps: - uses: actions/checkout@v4 @@ -38,9 +40,8 @@ jobs: - name: Compare versions id: validVersion run: | - VALID_VERSION=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) - echo "VALID_VERSION=$VALID_VERSION" - echo "VALID_VERSION=$VALID_VERSION" >> $GITHUB_OUTPUT + IS_VALID=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) + echo "versionIsValid=IS_VALID" >> $GITHUB_OUTPUT # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name @@ -49,7 +50,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} needs: verify-version - if: ${{ needs.verify-version.outputs.VALID_VERSION == 'true' }} + if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} runs-on: ${{ matrix.os }} continue-on-error: true From 4cfdc40b59952db2554f50c4ae1b623a7621959c Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:08:37 +0200 Subject: [PATCH 25/66] Use quotation marks --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dcaaf094b2..774466e648 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: id: validVersion run: | IS_VALID=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) - echo "versionIsValid=IS_VALID" >> $GITHUB_OUTPUT + echo "versionIsValid=IS_VALID" >> "$GITHUB_OUTPUT" # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name From fafb9107fc3c9b28acbd0229a979caa313e05a13 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:08:49 +0200 Subject: [PATCH 26/66] Add missing `$` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 774466e648..dbdc693476 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: id: validVersion run: | IS_VALID=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) - echo "versionIsValid=IS_VALID" >> "$GITHUB_OUTPUT" + echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name From 0667609b5a5328489720e9561f67051cac802329 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:10:26 +0200 Subject: [PATCH 27/66] Decrease version to 0.8.3 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fdde596c3..28c29d4ee8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index 5dfcf06e89..a9836c23f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.4" +version = "0.8.3" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From 8dafe097c622dddde2b09593677d75c4d4eaa2ab Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:14:45 +0200 Subject: [PATCH 28/66] Add echos --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbdc693476..7813b17ddc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,9 +40,17 @@ jobs: - name: Compare versions id: validVersion run: | - IS_VALID=$(node ./scripts/compareVersions.js ${{ steps.lookupVersionRelease.outputs.release }} ${{ steps.lookupVersion.outputs.result }}) + RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} + COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }}) + echo "Project version from newest release = $RELEASE_VERSION" + echo "Project version from this commit = $COMMIT_VERSION" + IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" + - name: Output job skipped + if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} + run: echo "Version from commit is not greater from newest release, skipping build" + # - name: Version check # if: steps.lookupVersion.outputs.result != github.ref_name # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 From fff761ea3fee38a005f166e8429c5aacce9943e8 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:15:01 +0200 Subject: [PATCH 29/66] Remove commented out code --- .github/workflows/release.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7813b17ddc..7206a6888e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name: Release on: push: -# tags: -# - v[0-9]+.* permissions: contents: write @@ -51,10 +49,6 @@ jobs: if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} run: echo "Version from commit is not greater from newest release, skipping build" - # - name: Version check - # if: steps.lookupVersion.outputs.result != github.ref_name - # run: echo "Project version in Cargo.toml does not match the tag" && exit 1 - build-binaries: name: Build ${{ matrix.target }} needs: verify-version From 40548cbe43687c5899346d4fa3bdf9a193342b3e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:16:23 +0200 Subject: [PATCH 30/66] Remove `)` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7206a6888e..63cc868b8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: id: validVersion run: | RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} - COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }}) + COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} echo "Project version from newest release = $RELEASE_VERSION" echo "Project version from this commit = $COMMIT_VERSION" IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION From aa8718ba830032c37c3c21c0bb57326b24c4802b Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:17:21 +0200 Subject: [PATCH 31/66] Fix syntax --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63cc868b8a..801accba70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} echo "Project version from newest release = $RELEASE_VERSION" echo "Project version from this commit = $COMMIT_VERSION" - IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION + IS_VALID=$(node ./scripts/compareVersions.js) $RELEASE_VERSION $COMMIT_VERSION echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" - name: Output job skipped From 16a1d27dd0df11cc1010e6cd00816a5f942dac91 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:21:05 +0200 Subject: [PATCH 32/66] Fix syntax --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 801accba70..adbc6bf92a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} echo "Project version from newest release = $RELEASE_VERSION" echo "Project version from this commit = $COMMIT_VERSION" - IS_VALID=$(node ./scripts/compareVersions.js) $RELEASE_VERSION $COMMIT_VERSION + IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" - name: Output job skipped From 4ab3af962a6cc4d39878646a7295eea06994a18e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:37:30 +0200 Subject: [PATCH 33/66] Add create tag action --- .github/workflows/create_release_tag.yml | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/create_release_tag.yml diff --git a/.github/workflows/create_release_tag.yml b/.github/workflows/create_release_tag.yml new file mode 100644 index 0000000000..f53fc0ddec --- /dev/null +++ b/.github/workflows/create_release_tag.yml @@ -0,0 +1,62 @@ +name: Release + +on: + push: + +permissions: + contents: write + +jobs: + verify-version: + runs-on: ubuntu-latest + outputs: + versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + cache: 'npm' + cache-dependency-path: scripts/package-lock.json + - run: npm ci + working-directory: scripts + + - name: Get version from Cargo.toml + id: lookupVersion + uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 + with: + cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' + + - name: Get version from the latest releases + id: lookupVersionRelease + uses: pozetroninc/github-action-get-latest-release@master + with: + owner: cptartur + repo: starknet-foundry + excludes: prerelease, draft + + - name: Compare versions + id: validVersion + run: | + RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} + COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} + echo "Project version from newest release = $RELEASE_VERSION" + echo "Project version from this commit = $COMMIT_VERSION" + IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) + echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" + + - name: Output job skipped + if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} + run: echo "Version from commit is not greater from newest release, skipping build" + + - name: Create tag + if: ${{ steps.validVersion.outputs.versionIsValid == 'true' }} + uses: actions/github-script@v6 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ steps.lookupVersion.outputs.result }}', + sha: context.sha + }) From 2d6f4a27f2e93bdda174b2de49dc34497db6f941 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:38:04 +0200 Subject: [PATCH 34/66] Rename tag action --- .github/workflows/create_release_tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release_tag.yml b/.github/workflows/create_release_tag.yml index f53fc0ddec..1eeeca25fd 100644 --- a/.github/workflows/create_release_tag.yml +++ b/.github/workflows/create_release_tag.yml @@ -1,4 +1,4 @@ -name: Release +name: Create release tag on: push: From 51eda025847d764578ba22e8af8a1db7bef2029f Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:39:48 +0200 Subject: [PATCH 35/66] Bump version --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28c29d4ee8..0fdde596c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index a9836c23f9..5dfcf06e89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.3" +version = "0.8.4" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From 54c22099097c39f9f2658c620e33368546e699d9 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:41:22 +0200 Subject: [PATCH 36/66] Trigger release on tag push --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adbc6bf92a..68f99b2444 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: Release on: push: + tags: + - v[0-9]+.* permissions: contents: write From e79bd5f4585b072394a85d7710f6a6560d4d9125 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:42:24 +0200 Subject: [PATCH 37/66] Remove unnecessary job output --- .github/workflows/create_release_tag.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/create_release_tag.yml b/.github/workflows/create_release_tag.yml index 1eeeca25fd..b619655f62 100644 --- a/.github/workflows/create_release_tag.yml +++ b/.github/workflows/create_release_tag.yml @@ -9,8 +9,6 @@ permissions: jobs: verify-version: runs-on: ubuntu-latest - outputs: - versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} steps: - uses: actions/checkout@v4 From 77df6ba66083a141c318c0b6e399e3e7c233fd59 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:45:06 +0200 Subject: [PATCH 38/66] Restore 0.8.3 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fdde596c3..28c29d4ee8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index 5dfcf06e89..a9836c23f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.4" +version = "0.8.3" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From 60cc8f9177df42272aea949668ffadb285de5211 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:46:05 +0200 Subject: [PATCH 39/66] Bump to 0.8.4 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28c29d4ee8..0fdde596c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index a9836c23f9..5dfcf06e89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.3" +version = "0.8.4" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From b71417a05a1efb9aaee166423fd7edec78802016 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:54:15 +0200 Subject: [PATCH 40/66] Trigger release on tag creation --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68f99b2444..fb90e6b313 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release on: - push: + create: tags: - v[0-9]+.* From b3f88cc30701d1b4f025400a5338064edbe44a87 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Thu, 19 Oct 2023 16:55:33 +0200 Subject: [PATCH 41/66] Push From 7a59f9ed58b531f828fcb751d1d56958fa98eeb5 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Fri, 20 Oct 2023 15:35:50 +0200 Subject: [PATCH 42/66] Create tag as part of release workflow --- .github/workflows/create_release_tag.yml | 60 ------------------------ .github/workflows/release.yml | 27 ++++++++++- 2 files changed, 25 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/create_release_tag.yml diff --git a/.github/workflows/create_release_tag.yml b/.github/workflows/create_release_tag.yml deleted file mode 100644 index b619655f62..0000000000 --- a/.github/workflows/create_release_tag.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Create release tag - -on: - push: - -permissions: - contents: write - -jobs: - verify-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v3 - with: - cache: 'npm' - cache-dependency-path: scripts/package-lock.json - - run: npm ci - working-directory: scripts - - - name: Get version from Cargo.toml - id: lookupVersion - uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 - with: - cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' - - - name: Get version from the latest releases - id: lookupVersionRelease - uses: pozetroninc/github-action-get-latest-release@master - with: - owner: cptartur - repo: starknet-foundry - excludes: prerelease, draft - - - name: Compare versions - id: validVersion - run: | - RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} - COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} - echo "Project version from newest release = $RELEASE_VERSION" - echo "Project version from this commit = $COMMIT_VERSION" - IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) - echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" - - - name: Output job skipped - if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} - run: echo "Version from commit is not greater from newest release, skipping build" - - - name: Create tag - if: ${{ steps.validVersion.outputs.versionIsValid == 'true' }} - uses: actions/github-script@v6 - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'refs/tags/${{ steps.lookupVersion.outputs.result }}', - sha: context.sha - }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb90e6b313..89cc9a6865 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ name: Release on: + push: + branches: + - 'master' create: tags: - v[0-9]+.* @@ -13,6 +16,7 @@ jobs: runs-on: ubuntu-latest outputs: versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} + version: ${{ steps.validVersion.outputs.version }} steps: - uses: actions/checkout@v4 @@ -46,15 +50,34 @@ jobs: echo "Project version from this commit = $COMMIT_VERSION" IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" + echo "version=$COMMIT_VERSION" >> "$GITHUB_OUTPUT" - name: Output job skipped if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} run: echo "Version from commit is not greater from newest release, skipping build" - build-binaries: - name: Build ${{ matrix.target }} + create-tag: + runs-on: ubuntu-latest needs: verify-version if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} + + steps: + - name: Create tag action was triggered by a push + if: ${{ github.event_name == 'pull_request' }} + uses: actions/github-script@v6 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ needs.verify-version.outputs.version }}', + sha: context.sha + }) + + build-binaries: + name: Build ${{ matrix.target }} + needs: create-tag + # if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} runs-on: ${{ matrix.os }} continue-on-error: true From 949272dc68f15a2751ed2b55723a1e1ffb100802 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Fri, 20 Oct 2023 15:40:07 +0200 Subject: [PATCH 43/66] Add names to jobs --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89cc9a6865..7c5f88c7bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ permissions: jobs: verify-version: + name: Verify that version that triggered this workflow is greater than most recent release runs-on: ubuntu-latest outputs: versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} @@ -57,6 +58,7 @@ jobs: run: echo "Version from commit is not greater from newest release, skipping build" create-tag: + name: If workflow was triggered by a push to master, create a new tag with release version runs-on: ubuntu-latest needs: verify-version if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} From 5966cedcffc4a79e526027e328ddf788ba6d397a Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:48:58 +0200 Subject: [PATCH 44/66] Require changelog in release workflow --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c5f88c7bb..7835703b32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -183,8 +183,9 @@ jobs: uses: taiki-e/create-gh-release-action@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 with: token: ${{ secrets.GITHUB_TOKEN }} + changelog: CHANGELOG.md + allow-missing-changelog: false title: $version - draft: true - name: Upload artifacts to the release working-directory: artifacts From eaab1e89d95cde2b865a19e4baa8c943399cb5b1 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:49:10 +0200 Subject: [PATCH 45/66] Add action to generate changelogs in PRs --- .github/workflows/generate_changelog.yml | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/generate_changelog.yml diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml new file mode 100644 index 0000000000..11b877c00d --- /dev/null +++ b/.github/workflows/generate_changelog.yml @@ -0,0 +1,76 @@ +name: Generate changelog in PR + +on: + pull_request: + +jobs: + verify-version: + name: Verify that version that triggered this workflow is greater than most recent release + runs-on: ubuntu-latest + outputs: + versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} + version: ${{ steps.validVersion.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + cache: 'npm' + cache-dependency-path: scripts/package-lock.json + - run: npm ci + working-directory: scripts + + - name: Get version from Cargo.toml + id: lookupVersion + uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 + with: + cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' + + - name: Get version from the latest releases + id: lookupVersionRelease + uses: pozetroninc/github-action-get-latest-release@master + with: + owner: cptartur + repo: starknet-foundry + excludes: prerelease, draft + + - name: Compare versions + id: validVersion + run: | + RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} + COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} + echo "Project version from newest release = $RELEASE_VERSION" + echo "Project version from this commit = $COMMIT_VERSION" + IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) + echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" + echo "version=$COMMIT_VERSION" >> "$GITHUB_OUTPUT" + + - name: Output job skipped + if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} + run: echo "Version from commit is not greater from newest release, skipping build" + + generate-changelog: + name: Convert unreleased section in CHANGELOG.md to new release + runs-on: ubuntu-latest + needs: verify-version + if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - run: sed -i 's/\[Unreleased\]/\${{ }} - $(date '+%Y-%m-%d')/' + + - name: Commit CHANGELOG.md + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add CHANGELOG.md + git commit -m "Add changes" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + branch: ${{ github.head_ref }} From 3bec079fe7772f7aa0d2466a1c8f5e2d3cdc5ca6 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:50:11 +0200 Subject: [PATCH 46/66] Temporarily disable building artifacts --- .github/workflows/release.yml | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7835703b32..c48aa1ecdd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,24 +140,24 @@ jobs: run: | echo "CARGO=cross" >> $GITHUB_ENV - - name: Build - run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} - - - name: Package - shell: bash - run: | - set -euxo pipefail - PKG_FULL_NAME="starknet-foundry-${{ github.ref_name }}-${{ matrix.target }}" - echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV - - chmod +x ./scripts/package.sh - ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: build-${{ matrix.target }} - path: ${{ env.PKG_FULL_NAME }}.* +# - name: Build +# run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} +# +# - name: Package +# shell: bash +# run: | +# set -euxo pipefail +# PKG_FULL_NAME="starknet-foundry-${{ github.ref_name }}-${{ matrix.target }}" +# echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV +# +# chmod +x ./scripts/package.sh +# ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" +# +# - name: Upload artifact +# uses: actions/upload-artifact@v3 +# with: +# name: build-${{ matrix.target }} +# path: ${{ env.PKG_FULL_NAME }}.* create-release: name: Draft release @@ -168,15 +168,15 @@ jobs: with: submodules: true - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts-dl - - - name: Unpack artifacts to staging directory - run: | - mkdir -p artifacts - mv artifacts-dl/build-*/starknet-foundry-* artifacts/ +# - name: Download artifacts +# uses: actions/download-artifact@v3 +# with: +# path: artifacts-dl +# +# - name: Unpack artifacts to staging directory +# run: | +# mkdir -p artifacts +# mv artifacts-dl/build-*/starknet-foundry-* artifacts/ - name: Draft GitHub release id: draft-release @@ -187,9 +187,9 @@ jobs: allow-missing-changelog: false title: $version - - name: Upload artifacts to the release - working-directory: artifacts - run: gh release upload "$TAG" * - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ steps.draft-release.outputs.computed-prefix }}${{ steps.draft-release.outputs.version }} +# - name: Upload artifacts to the release +# working-directory: artifacts +# run: gh release upload "$TAG" * +# env: +# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# TAG: ${{ steps.draft-release.outputs.computed-prefix }}${{ steps.draft-release.outputs.version }} From 8c7db1e08f13554824946e5da9d379eff7a9e030 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:55:27 +0200 Subject: [PATCH 47/66] Specify tag in the release creation workflow --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c48aa1ecdd..54ade4783c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,7 +162,7 @@ jobs: create-release: name: Draft release runs-on: ubuntu-latest - needs: build-binaries + needs: [build-binaries, verify-version] steps: - uses: actions/checkout@v4 with: @@ -186,6 +186,7 @@ jobs: changelog: CHANGELOG.md allow-missing-changelog: false title: $version + ref: refs/tags/{{ needs.verify-version.outputs.version }} # - name: Upload artifacts to the release # working-directory: artifacts From e3d4300c802416a739c429ef06a040f8cf473d37 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:56:39 +0200 Subject: [PATCH 48/66] Fix tag creation trigger --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54ade4783c..149ac30b3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: steps: - name: Create tag action was triggered by a push - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'push' }} uses: actions/github-script@v6 with: script: | From 872b8264dd94fabd9f1b3a06649d37fb73e2e7b4 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 10:58:51 +0200 Subject: [PATCH 49/66] Add missing `$` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 149ac30b3f..3f91826b0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -186,7 +186,7 @@ jobs: changelog: CHANGELOG.md allow-missing-changelog: false title: $version - ref: refs/tags/{{ needs.verify-version.outputs.version }} + ref: refs/tags/${{ needs.verify-version.outputs.version }} # - name: Upload artifacts to the release # working-directory: artifacts From 6fcc211eb4735c3b797c57bd71f949bc9c3773ae Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:06:51 +0200 Subject: [PATCH 50/66] Use double quotes in sed command --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 11b877c00d..46a9e198d0 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -61,7 +61,7 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - run: sed -i 's/\[Unreleased\]/\${{ }} - $(date '+%Y-%m-%d')/' + - run: sed -i "s/\[Unreleased\]/\${{ }} - $(date '+%Y-%m-%d')/" - name: Commit CHANGELOG.md run: | From 5abb9a9ce8dd0d418b4ca5abd4c243a80f9994dd Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:10:59 +0200 Subject: [PATCH 51/66] Fix expression --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 46a9e198d0..3d685e7b79 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -61,7 +61,7 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - run: sed -i "s/\[Unreleased\]/\${{ }} - $(date '+%Y-%m-%d')/" + - run: sed -i "s/\[Unreleased\]/\${{ needs.verify-version.outputs.version }} - $(date '+%Y-%m-%d')/" - name: Commit CHANGELOG.md run: | From 5a1c15bf8eacb9d0cebb7290f35e96b6af194240 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:12:31 +0200 Subject: [PATCH 52/66] Specficy what file to use in sed command --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 3d685e7b79..904d27a464 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -61,7 +61,7 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - run: sed -i "s/\[Unreleased\]/\${{ needs.verify-version.outputs.version }} - $(date '+%Y-%m-%d')/" + - run: sed -i "s/\[Unreleased\]/\${{ needs.verify-version.outputs.version }} - $(date '+%Y-%m-%d')/" CHANGELOG.md - name: Commit CHANGELOG.md run: | From 3a0a85782a85903fc4e89277a1cefa30f264d41d Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:15:31 +0200 Subject: [PATCH 53/66] Add write permission to changelog action --- .github/workflows/generate_changelog.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 904d27a464..2e7438313c 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -3,6 +3,9 @@ name: Generate changelog in PR on: pull_request: +permissions: + contents: write + jobs: verify-version: name: Verify that version that triggered this workflow is greater than most recent release From 3c4092fc85138a0d508cc0be14916d806fbf0982 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:18:13 +0200 Subject: [PATCH 54/66] Add square brackets to heading --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 2e7438313c..2fb41c95c0 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -64,7 +64,7 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - run: sed -i "s/\[Unreleased\]/\${{ needs.verify-version.outputs.version }} - $(date '+%Y-%m-%d')/" CHANGELOG.md + - run: sed -i "s/\[Unreleased\]/\[${{ needs.verify-version.outputs.version }}\] - $(date '+%Y-%m-%d')/" CHANGELOG.md - name: Commit CHANGELOG.md run: | From 95345c8ab6279fe83e42bdcb51eb2f628ef9606e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:19:06 +0200 Subject: [PATCH 55/66] Use better commit message for changelog update --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 2fb41c95c0..8b7c249f6b 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -71,7 +71,7 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git add CHANGELOG.md - git commit -m "Add changes" + git commit -m "Update CHANGELOG.md" - name: Push changes uses: ad-m/github-push-action@master From 1b79986f55ab31393031d02ea440a093d1c83677 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:24:31 +0200 Subject: [PATCH 56/66] Strip `v` from version in changelog --- .github/workflows/generate_changelog.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 8b7c249f6b..98ea5c2447 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -64,7 +64,10 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - run: sed -i "s/\[Unreleased\]/\[${{ needs.verify-version.outputs.version }}\] - $(date '+%Y-%m-%d')/" CHANGELOG.md + - run: | + RELEASE_VERSION=${{ needs.verify-version.outputs.version }} + RELEASE_VERSION="${RELEASE_VERSION:1}" + sed -i "s/\[Unreleased\]/\[${RELEASE_VERSION}\] - $(date '+%Y-%m-%d')/" CHANGELOG.md - name: Commit CHANGELOG.md run: | From 85ef49953504b5b07944a5cb099fe703f4f70644 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 11:34:48 +0200 Subject: [PATCH 57/66] Use Krakow timezone --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 98ea5c2447..9b4fe8685c 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -67,7 +67,7 @@ jobs: - run: | RELEASE_VERSION=${{ needs.verify-version.outputs.version }} RELEASE_VERSION="${RELEASE_VERSION:1}" - sed -i "s/\[Unreleased\]/\[${RELEASE_VERSION}\] - $(date '+%Y-%m-%d')/" CHANGELOG.md + sed -i "s/\[Unreleased\]/\[${RELEASE_VERSION}\] - $(TZ=Europe/Krakow date '+%Y-%m-%d')/" CHANGELOG.md - name: Commit CHANGELOG.md run: | From 8bcdecbc131f4032ccf36e94dd00e9c4dc768f6d Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 12:06:52 +0200 Subject: [PATCH 58/66] Update replacing logic --- .github/workflows/generate_changelog.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 9b4fe8685c..2e4cf011bd 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -67,7 +67,10 @@ jobs: - run: | RELEASE_VERSION=${{ needs.verify-version.outputs.version }} RELEASE_VERSION="${RELEASE_VERSION:1}" - sed -i "s/\[Unreleased\]/\[${RELEASE_VERSION}\] - $(TZ=Europe/Krakow date '+%Y-%m-%d')/" CHANGELOG.md + + if ! grep -q $RELEASE_VERSION CHANGELOG.md; then + sed -i "s/## \[Unreleased\]/## \[Unreleased\]\n\n## \[${RELEASE_VERSION}\] - $(TZ=Europe/Krakow date '+%Y-%m-%d')/" CHANGELOG.md + if - name: Commit CHANGELOG.md run: | From f6be510359b8e36195010fa5dd60053123708610 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 12:08:53 +0200 Subject: [PATCH 59/66] Replace `if` with `fi` --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 2e4cf011bd..8cf34df6fd 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -70,7 +70,7 @@ jobs: if ! grep -q $RELEASE_VERSION CHANGELOG.md; then sed -i "s/## \[Unreleased\]/## \[Unreleased\]\n\n## \[${RELEASE_VERSION}\] - $(TZ=Europe/Krakow date '+%Y-%m-%d')/" CHANGELOG.md - if + fi - name: Commit CHANGELOG.md run: | From c04abcdce596a7d0167d8adbcce2aef3d323f271 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 12:17:59 +0200 Subject: [PATCH 60/66] Only commit changelog if it was updated --- .github/workflows/generate_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 8cf34df6fd..584f67caf8 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -77,7 +77,7 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git add CHANGELOG.md - git commit -m "Update CHANGELOG.md" + git diff --cached --quiet || git commit -m "Update CHANGELOG.md" - name: Push changes uses: ad-m/github-push-action@master From ba844ac7f7e2b3c889009024a40bea77a9cd24d6 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 12:28:19 +0200 Subject: [PATCH 61/66] Restore commented out code --- .github/workflows/release.yml | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f91826b0f..0048c06c2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,24 +140,24 @@ jobs: run: | echo "CARGO=cross" >> $GITHUB_ENV -# - name: Build -# run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} -# -# - name: Package -# shell: bash -# run: | -# set -euxo pipefail -# PKG_FULL_NAME="starknet-foundry-${{ github.ref_name }}-${{ matrix.target }}" -# echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV -# -# chmod +x ./scripts/package.sh -# ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" -# -# - name: Upload artifact -# uses: actions/upload-artifact@v3 -# with: -# name: build-${{ matrix.target }} -# path: ${{ env.PKG_FULL_NAME }}.* + - name: Build + run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} + + - name: Package + shell: bash + run: | + set -euxo pipefail + PKG_FULL_NAME="starknet-foundry-${{ github.ref_name }}-${{ matrix.target }}" + echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV + + chmod +x ./scripts/package.sh + ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: build-${{ matrix.target }} + path: ${{ env.PKG_FULL_NAME }}.* create-release: name: Draft release @@ -168,15 +168,15 @@ jobs: with: submodules: true -# - name: Download artifacts -# uses: actions/download-artifact@v3 -# with: -# path: artifacts-dl -# -# - name: Unpack artifacts to staging directory -# run: | -# mkdir -p artifacts -# mv artifacts-dl/build-*/starknet-foundry-* artifacts/ + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts-dl + + - name: Unpack artifacts to staging directory + run: | + mkdir -p artifacts + mv artifacts-dl/build-*/starknet-foundry-* artifacts/ - name: Draft GitHub release id: draft-release @@ -188,9 +188,9 @@ jobs: title: $version ref: refs/tags/${{ needs.verify-version.outputs.version }} -# - name: Upload artifacts to the release -# working-directory: artifacts -# run: gh release upload "$TAG" * -# env: -# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# TAG: ${{ steps.draft-release.outputs.computed-prefix }}${{ steps.draft-release.outputs.version }} + - name: Upload artifacts to the release + working-directory: artifacts + run: gh release upload "$TAG" * + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.draft-release.outputs.computed-prefix }}${{ steps.draft-release.outputs.version }} From 26b59bb44591db7c532b447c020ce3f927bc87ee Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 12:28:32 +0200 Subject: [PATCH 62/66] Remove commented out code --- scripts/compareVersions.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/compareVersions.js b/scripts/compareVersions.js index f35f157a2f..d81440e0fa 100644 --- a/scripts/compareVersions.js +++ b/scripts/compareVersions.js @@ -8,8 +8,4 @@ if (process.argv.length !== 4) { const old_version = process.argv[2]; const new_version = process.argv[3]; -// if (!semver.gt(new_version, old_version)) { -// console.error('Version is not greater than previous release'); -// process.exit(2); -// } console.log((semver.gt(new_version, old_version)).toString()) From 35b4d78e4cb600a8dc6d177099d21d5cf3ca2bfd Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 14:01:24 +0200 Subject: [PATCH 63/66] Trigger release From 8da39a8bfa7c336b63ca3f3494ec53dbf934b7c2 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 14:02:17 +0200 Subject: [PATCH 64/66] Restore 0.8.3 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fdde596c3..28c29d4ee8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.4" +version = "0.8.3" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index 5dfcf06e89..a9836c23f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.4" +version = "0.8.3" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT" From ff10bd191b64535bdd09ea0c29e90d5b97a21180 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 14:02:29 +0200 Subject: [PATCH 65/66] Use foundry-rs repo in lookupVersionRelesae --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0048c06c2c..da9a33a81d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: id: lookupVersionRelease uses: pozetroninc/github-action-get-latest-release@master with: - owner: cptartur + owner: foundry-rs repo: starknet-foundry excludes: prerelease, draft From 2346a150ee6221a4c125101abb5231be4f5c5b2f Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 23 Oct 2023 14:06:49 +0200 Subject: [PATCH 66/66] Bump version 0.8.4 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28c29d4ee8..0fdde596c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cast" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "camino", @@ -1757,7 +1757,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index a9836c23f9..5dfcf06e89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.8.3" +version = "0.8.4" edition = "2021" repository = "https://github.com/foundry-rs/starknet-foundry" license = "MIT"