diff --git a/.changeset/tall-suns-carry.md b/.changeset/tall-suns-carry.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/tall-suns-carry.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/unpublish-npm.yaml b/.github/workflows/unpublish-npm.yaml deleted file mode 100644 index 40a1748b42..0000000000 --- a/.github/workflows/unpublish-npm.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Unpublish old versions" - -on: - workflow_dispatch: - inputs: - delete_packages: - type: boolean - description: Delete packages? otherwise dry-run mode will be used - default: false - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - clean-npm-versions: - name: Unpublish versions next, preview, master... - runs-on: buildjet-4vcpu-ubuntu-2204 - steps: - - uses: actions/checkout@v3 - - uses: FuelLabs/github-actions/setups/node@master - with: - node-version: 20.11.0 - pnpm-version: 9.5.0 - - uses: FuelLabs/github-actions/setups/npm@master - with: - npm-token: ${{ secrets.NPM_TOKEN }} - - run: | - node ./scripts/unpublish.js - env: - DELETE_PACKAGES: ${{ github.event.inputs.delete_packages}} diff --git a/.github/workflows/update-sdk-cron.yaml b/.github/workflows/update-sdk-cron.yaml deleted file mode 100644 index a04d87134a..0000000000 --- a/.github/workflows/update-sdk-cron.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Check SDK updates - -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: write - pull-requests: write - -jobs: - update-version: - runs-on: buildjet-4vcpu-ubuntu-2204 - strategy: - matrix: - tag: ['latest'] # Currently only "latest" tag is available across all packages - - steps: - - uses: actions/checkout@v3 - - uses: FuelLabs/github-actions/setups/node@master - with: - node-version: 20.11.0 - pnpm-version: 9.5.0 - - - name: Checking updates - uses: FuelLabs/github-actions/update-sdk@master - with: - branch: master - changeset: true - packages: fuels,@fuels/react,@fuels/connectors - npm-tag: ${{ matrix.tag }} - env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} diff --git a/.github/workflows/update-sdk-manual.yaml b/.github/workflows/update-sdk-manual.yaml deleted file mode 100644 index 35c69088f2..0000000000 --- a/.github/workflows/update-sdk-manual.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Check SDK updates (manual) - -on: - workflow_dispatch: - inputs: - publisher: - description: Publisher repo name (e.g. fuels-ts) - required: false - issue: - description: Publisher repo issue (e.g. 1905) - required: false - packages: - description: Packages to update (comma separated) - default: fuels - required: true - tag: - description: NPM tag to use - default: latest - required: true - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: write - pull-requests: write - -jobs: - update-version: - runs-on: buildjet-4vcpu-ubuntu-2204 - - steps: - - uses: actions/checkout@v3 - - uses: FuelLabs/github-actions/setups/node@master - with: - node-version: 20.11.0 - pnpm-version: 9.5.0 - - - name: Checking updates - id: update - uses: FuelLabs/github-actions/update-sdk@master - with: - branch: master - changeset: true - packages: ${{ inputs.packages }} - npm-tag: ${{ inputs.tag }} - env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} - - - name: Add PR comment on the publisher repo - if: steps.update.outputs['has-updates'] == 'true' && inputs.issue && inputs.publisher - uses: mshick/add-pr-comment@v2 - with: - repo-name: ${{ inputs.publisher }} - issue: ${{ inputs.issue }} - repo-token: ${{ secrets.REPO_TOKEN }} - message: | - āœØ A PR has been created under the `${{ inputs.tag }}` tag on `fuels-wallet` repo. - ${{ steps.update.outputs.pr }} \ No newline at end of file diff --git a/scripts/unpublish.js b/scripts/unpublish.js deleted file mode 100644 index fdb40b16ec..0000000000 --- a/scripts/unpublish.js +++ /dev/null @@ -1,89 +0,0 @@ -const { readFile, readdir } = require('node:fs').promises; -const { join } = require('node:path'); -const util = require('node:util'); -const { compare } = require('compare-versions'); -const exec = util.promisify(require('node:child_process').exec); -const { version } = require('../packages/app/package.json'); - -const DELETE_TAGS = /next|preview|master|rc/; -const CURRENT_VERSION = version; -const DELETE_PACKAGES = process.env.DELETE_PACKAGES === 'true'; -const dryRun = DELETE_PACKAGES ? '' : '--dry-run'; - -async function getPublicPackages() { - const base = join(__dirname, '../packages'); - const packages = await readdir(base, { - withFileTypes: true, - }); - - const packagesNames = await Promise.all( - packages.map(async (p) => { - try { - const packageContent = await readFile( - join(base, p.name, 'package.json'), - 'utf8' - ); - const pkg = JSON.parse(packageContent.toString()); - - if (pkg.private) return null; - return pkg.name; - } catch (_err) { - return null; - } - }) - ); - return packagesNames.filter((p) => !!p); -} - -async function main() { - console.log('Get public packages'); - const packages = await getPublicPackages(); - - for (const packageName of packages) { - console.log( - [ - '\n', - '##############################################', - `āž”ļø ${packageName}`, - '##############################################', - '\n', - ].join('\n') - ); - console.log(`šŸ“¦ Fetching ${packageName} versions`); - const { versions } = await fetch( - `https://registry.npmjs.org/${packageName}` - ).then((resp) => resp.json()); - const versionsToDelete = Object.keys(versions).filter((version) => { - // Filter all versions that have tags like next, master, preview but are not related to the current version. - // This avoids for current WIP versions to be deleted during test. - return ( - version.search(DELETE_TAGS) > -1 && - !compare(version, CURRENT_VERSION, '>=') - ); - }); - console.log('The following versions will be deleted:'); - console.log(versionsToDelete.map((v) => ` - ${v}`).join('\n')); - for (const versionDelete of versionsToDelete) { - console.log(`\nšŸ—‘ļø Deleting ${packageName}@${versionDelete}...`); - console.log(dryRun); - const { stderr } = await exec( - `npm unpublish ${packageName}@${versionDelete} ${dryRun}` - ); - if (stderr) { - console.log(`āŒ Error ${packageName}@${versionDelete} not deleted!\n`); - console.log(stderr); - } else { - console.log(`āœ… Package ${packageName}@${versionDelete} deleted!\n`); - } - } - } -} - -main() - .then(() => { - console.log('āœ… Packages versions removed successfully'); - }) - .catch((err) => { - console.error(err); - process.exit(1); - });