diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml deleted file mode 100644 index 4bb12b5..0000000 --- a/.github/workflows/pr-release.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: Release to @pr- tag on npm -on: - pull_request: - workflow_dispatch: - -jobs: - release-pr: - name: 'Release PR to npm' - runs-on: buildjet-4vcpu-ubuntu-2204 - # Comment if:false to enable release PR to npm - if: false - permissions: write-all - steps: - - uses: actions/checkout@v3 - with: - # need this to get full git-history/clone in order to build changelogs and check changesets - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - - - 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 }} - - - name: Build - run: pnpm build - - - name: Release to @pr-${{ github.event.pull_request.number }} tag on npm - id: release - run: | - pnpm changeset:next - git add .changeset/fuel-labs-ci.md - pnpm changeset version --snapshot pr-${{ env.PR_NUMBER }} - changetsets=$(pnpm changeset publish --tag pr-${{ env.PR_NUMBER }}) - published_version=$(echo "$changetsets" | grep -oP '@\K([0-9]+\.){2}[0-9]+-pr-${{ env.PR_NUMBER }}-\d+' | head -1) - echo "published_version=$published_version" >> $GITHUB_OUTPUT - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - - - uses: mshick/add-pr-comment@v2 - with: - message: | - This PR is published in NPM with version **${{ steps.release.outputs.published_version }}** - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 74bc74b..5c101a1 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -6,7 +6,7 @@ on: types: [opened, synchronize, reopened] push: branches: - - release + - main concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -15,19 +15,21 @@ concurrency: env: FORC_VERSION: 0.63.3 CORE_VERSION: 0.35.0 + NODE_VERSION: 20.11.0 + PNPM_VERSION: 9.5.0 jobs: tests-vitest: name: Vitest Tests runs-on: buildjet-4vcpu-ubuntu-2204 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Node uses: FuelLabs/github-actions/setups/node@master with: - node-version: 20.11.0 - pnpm-version: 9.5.0 + node-version: ${{ env.NODE_VERSION }} + pnpm-version: ${{ env.PNPM_VERSION }} - uses: FuelLabs/github-actions/setups/docker@master with: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7e2801e..229864f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,4 +1,4 @@ -name: 'PR Checks' +name: "PR Checks" on: pull_request: @@ -8,6 +8,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + NODE_VERSION: 20.11.0 + PNPM_VERSION: 9.5.0 + jobs: validate-title: name: Validate PR Title @@ -23,13 +27,13 @@ jobs: outputs: changed: ${{ steps.packages-changed.outputs.any_changed }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check external packages changes id: packages-changed uses: tj-actions/changed-files@v22.2 with: files: | - **/packages/connectors/** + **/packages/fuel-streams/** validate-changeset: name: Validate PR Changeset @@ -38,15 +42,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: CI Setup + - name: Setup Node uses: FuelLabs/github-actions/setups/node@master with: - node-version: 20.11.0 - pnpm-version: 9.5.0 + node-version: ${{ env.NODE_VERSION }} + pnpm-version: ${{ env.PNPM_VERSION }} - name: Validate Changeset run: pnpm changeset status --since=origin/${{ github.base_ref }} @@ -56,11 +60,11 @@ jobs: runs-on: ubuntu-latest if: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: FuelLabs/github-actions/setups/node@master with: - node-version: 20.11.0 - pnpm-version: 9.5.0 + node-version: ${{ env.NODE_VERSION }} + pnpm-version: ${{ env.PNPM_VERSION }} - run: pnpm audit --prod lint: @@ -72,13 +76,13 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node uses: FuelLabs/github-actions/setups/node@master with: - node-version: 20.11.0 - pnpm-version: 9.5.0 + node-version: ${{ env.NODE_VERSION }} + pnpm-version: ${{ env.PNPM_VERSION }} - name: Run lint & ts:check run: | diff --git a/.github/workflows/release-npm-latest.yaml b/.github/workflows/release-npm-latest.yaml deleted file mode 100644 index d03b8bd..0000000 --- a/.github/workflows/release-npm-latest.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Release latest" - -on: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - BUILD_VERSION: "" - -jobs: - release-npm-latest: - name: Tag packages as latest - runs-on: buildjet-4vcpu-ubuntu-2204 - steps: - - uses: actions/checkout@v3 - with: - # need this to get full git-history/clone in order to build changelogs and check changesets - fetch-depth: 0 - - 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 }} - - - name: Collect current version - run: | - echo "BUILD_VERSION=$(pnpm -s packages:version)" >> $GITHUB_ENV - - - name: Change tag to latest - run: | - npm dist-tag add @fuels/connectors@${{ env.BUILD_VERSION }} latest - npm dist-tag add @fuels/react@${{ env.BUILD_VERSION }} latest diff --git a/.github/workflows/release-npm-preview.yaml b/.github/workflows/release-npm-preview.yaml deleted file mode 100644 index aa6f5c3..0000000 --- a/.github/workflows/release-npm-preview.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Release to @preview tag on npm - -on: - workflow_dispatch: - -env: - BUILD_VERSION: "" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - release-changesets: - name: Release to @preview tag on npm - runs-on: buildjet-4vcpu-ubuntu-2204 - permissions: - pull-requests: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - 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 }} - - - name: Build Lib - run: pnpm build - env: - ## increase node.js m memory limit for building - ## with sourcemaps - NODE_OPTIONS: "--max-old-space-size=4096" - - - name: Release to @preview tag on npm - id: release - run: | - pnpm changeset version --snapshot preview - changetsets=$(pnpm changeset publish --tag preview) - echo "BUILD_VERSION=$(pnpm -s packages:version)" >> $GITHUB_ENV - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Comment release package name to PR - uses: mshick/add-pr-comment@v2 - with: - message: | - This PR is published in NPM with version **${{ env.BUILD_VERSION }}** - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-npm.yaml b/.github/workflows/release-npm.yaml index d2b9024..4515f40 100644 --- a/.github/workflows/release-npm.yaml +++ b/.github/workflows/release-npm.yaml @@ -1,4 +1,4 @@ -name: 'Release' +name: "Release" on: push: @@ -10,21 +10,25 @@ concurrency: cancel-in-progress: true env: - BUILD_VERSION: '' + BUILD_VERSION: "" + NODE_VERSION: 20.11.0 + PNPM_VERSION: 9.5.0 jobs: release-changesets: name: Release main or rc runs-on: buildjet-4vcpu-ubuntu-2204 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # need this to get full git-history/clone in order to build changelogs and check changesets fetch-depth: 0 + - uses: FuelLabs/github-actions/setups/node@master with: - node-version: 20.11.0 - pnpm-version: 9.5.0 + node-version: ${{ env.NODE_VERSION }} + pnpm-version: ${{ env.PNPM_VERSION }} + - uses: FuelLabs/github-actions/setups/npm@master with: npm-token: ${{ secrets.NPM_TOKEN }} @@ -50,13 +54,13 @@ jobs: uses: FuelLabs/changesets-action@main with: publish: pnpm changeset publish --tag next - commit: 'ci(changesets): versioning packages' - title: 'ci(changesets): versioning packages' + 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 }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Release to @main tag diff --git a/.github/workflows/unpublish-npm.yaml b/.github/workflows/unpublish-npm.yaml deleted file mode 100644 index 94d74aa..0000000 --- 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, main... - 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/packages/fuel-streams/package.json b/packages/fuel-streams/package.json index 8f98b77..80f00d6 100644 --- a/packages/fuel-streams/package.json +++ b/packages/fuel-streams/package.json @@ -1,13 +1,14 @@ { "name": "@fuels/streams", "version": "0.0.1", - "private": true, + "description": "Official data streaming Typescript library for Fuel Network", + "author": "Fuel Labs (https://fuel.network/)", + "homepage": "https://github.com/FuelLabs/fuel-streams-js", "main": "./src/index.ts", "exports": { ".": "./src/index.ts" }, "publishConfig": { - "private": false, "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts",