Skip to content

Commit

Permalink
chore: regenerate proxy artifacts during release (#3221)
Browse files Browse the repository at this point in the history
* Re-building proxy stuff

* Adjusting release step to include proxy related stuff

* Adding changeset

* Making sure proxy changes are added before creating commit

---------

Co-authored-by: Sérgio Torres <[email protected]>
  • Loading branch information
arboleya and Torres-ssf authored Sep 27, 2024
1 parent f02fa88 commit ebd82b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-bikes-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels": patch
---

chore: regenerate proxy artifacts during release
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable @typescript-eslint/consistent-type-imports */

/*
Fuels version: 0.94.6
Fuels version: 0.94.7
*/

import { Contract, Interface } from "../../../../..";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable @typescript-eslint/consistent-type-imports */

/*
Fuels version: 0.94.6
Fuels version: 0.94.7
*/

import { Contract, ContractFactory, decompressBytecode } from "../../../../..";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable @typescript-eslint/consistent-type-imports */

/*
Fuels version: 0.94.6
Fuels version: 0.94.7
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable @typescript-eslint/consistent-type-imports */

/*
Fuels version: 0.94.6
Fuels version: 0.94.7
*/

export { Src14OwnedProxy } from './Src14OwnedProxy';
Expand Down
20 changes: 16 additions & 4 deletions scripts/changeset/changeset-version-with-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,34 @@ import { error } from 'console';
try {
/**
* This is the base command that has to run always.
* Release CIs were failing when there were only empty changesets because we weren't running this command.
* See more here: https://github.com/FuelLabs/fuels-ts/pull/1847
*
* Release CIs were failing when there were only empty changesets
* because we weren't running this command.
*
* See more here:
* https://github.com/FuelLabs/fuels-ts/pull/1847
*/
execSync(`changeset version`);

// Invoke versions' prebuild script (will rewrite version files if needed)
execSync(`pnpm -C packages/versions prebuild`);

// Invoke fuels' build:proxy script (will rewrite header versions in generated files)
execSync(`pnpm -C packages/fuels build:proxy`);

// Checks if the commands above generated git changes
const versionsFilePath = `packages/versions/src/lib/getBuiltinVersions.ts`;
const proxyDirPath = `packages/fuels/src/cli/commands/deploy/proxy`;

const versionsChanged = !!execSync(`git status --porcelain ${versionsFilePath}`)
.toString()
.trim();

if (versionsChanged) {
execSync(`git add ${versionsFilePath}`);
const proxyChanged = !!execSync(`git status --porcelain ${proxyDirPath}`).toString().trim();

// If they did, add and commit the changes
if (versionsChanged || proxyChanged) {
execSync(`git add ${versionsFilePath} ${proxyDirPath}`);
execSync(`git commit -m"ci(scripts): update versions"`);
}
} catch (err) {
Expand Down

0 comments on commit ebd82b0

Please sign in to comment.