Skip to content

Commit

Permalink
chore: remove npm publish (#1165)
Browse files Browse the repository at this point in the history
Make `@fuel-wallet/connections` and `@fuel-wallet/types` private
packages.
  • Loading branch information
helciofranco authored Mar 22, 2024
1 parent d32c7bd commit ec58815
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 144 deletions.
7 changes: 7 additions & 0 deletions .changeset/slimy-windows-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fuel-wallet/connections": patch
"@fuel-wallet/types": patch
---

ci: make connections and types packages private
we don't need to use publish them anymore because it's going to be used only by the CRX
26 changes: 0 additions & 26 deletions .github/setup-forc/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
with:
# need this to get full git-history/clone in order to build changelogs and check changesets
fetch-depth: 0
# workaround to ensure force pushes to changeset branch use REPO_TOKEN owner's account
# see https://github.com/changesets/action/issues/70
persist-credentials: false
- uses: FuelLabs/github-actions/setups/node@master
- uses: FuelLabs/github-actions/setups/npm@master
with:
npm-token: ${{ secrets.NPM_TOKEN }}

- name: Bump and Collect Version
run: |
Expand All @@ -39,13 +39,6 @@ jobs:
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Build Libs
run: pnpm build:libs
env:
## increase node.js m memory limit for building
## with sourcemaps
NODE_OPTIONS: "--max-old-space-size=4096"

- name: Build Fuel Wallet
run: pnpm build:crx
env:
Expand All @@ -62,32 +55,20 @@ jobs:
APP_VERSION_POSTFIX: "-development"
NODE_OPTIONS: "--max-old-space-size=4096"

- name: Create Release Pull Request or Publish to NPM
- name: Create Release Pull Request
id: changesets
uses: FuelLabs/changesets-action@main
with:
publish: pnpm changeset publish --tag rc
commit: "ci(changesets): versioning packages"
title: "ci(changesets): versioning packages"
createGithubReleases: aggregate
githubReleaseName: v${{ env.BUILD_VERSION }}
githubTagName: v${{ env.BUILD_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release to @master tag
if: steps.changesets.outputs.published != 'true'
run: |
git checkout master
pnpm changeset version --snapshot master
pnpm changeset publish --tag master
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload aritifacts to Sentry
if: steps.changesets.outputs.published == 'true'
- name: Upload artifacts to Sentry
if: !steps.changesets.outputs.pullRequestNumber
run: |
pnpm sentry-cli sourcemaps inject --release ${{ env.BUILD_VERSION }} ./dist-crx
pnpm sentry-cli sourcemaps upload --release ${{ env.BUILD_VERSION }} ./dist-crx
Expand All @@ -98,7 +79,7 @@ jobs:
working-directory: ./packages/app

- name: Attach Fuel Wallet to release
if: steps.changesets.outputs.published == 'true'
if: !steps.changesets.outputs.pullRequestNumber
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/release-npm-latest.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/release-npm-preview.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/update-sdk-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
# workaround to ensure force pushes to changeset branch use REPO_TOKEN owner's account
# see https://github.com/changesets/action/issues/70
persist-credentials: false
- uses: FuelLabs/github-actions/setups/node@master

- name: Checking updates
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-sdk-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
# workaround to ensure force pushes to changeset branch use REPO_TOKEN owner's account
# see https://github.com/changesets/action/issues/70
persist-credentials: false
- uses: FuelLabs/github-actions/setups/node@master

- name: Checking updates
Expand Down
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
},
"files": {
"ignore": [
".changeset",
".vscode",
"**/scripts",
"**/node_modules",
Expand Down
1 change: 1 addition & 0 deletions packages/connections/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@fuel-wallet/connections",
"private": true,
"description": "Fuel Wallet Connections for CRX.",
"version": "0.16.1",
"license": "Apache-2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@fuel-wallet/types",
"private": true,
"version": "0.16.1",
"license": "Apache-2.0",
"main": "src/index.ts",
Expand Down
18 changes: 10 additions & 8 deletions scripts/unpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@ 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/;
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 packages = await readdir(join(__dirname, '../packages'), {
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(p.path, p.name, 'package.json'),
join(base, p.name, 'package.json'),
'utf8'
);
const package = JSON.parse(packageContent.toString());
const pkg = JSON.parse(packageContent.toString());

if (package.private) return null;
return package.name;
} catch (err) {
if (pkg.private) return null;
return pkg.name;
} catch (_err) {
return null;
}
})
Expand All @@ -34,7 +36,7 @@ async function getPublicPackages() {
}

async function main() {
console.log(`Get public packages`);
console.log('Get public packages');
const packages = await getPublicPackages();

for (const packageName of packages) {
Expand Down

0 comments on commit ec58815

Please sign in to comment.