From 07ea3e2eee8a29a0266f65a87a5539d3dff9a98b Mon Sep 17 00:00:00 2001 From: abhishek jha Date: Thu, 4 Apr 2024 11:30:53 +0530 Subject: [PATCH 1/3] Removed workflows --- .github/workflows/release.yml | 77 ----------------------------------- .github/workflows/tests.yml | 29 ------------- 2 files changed, 106 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e9a60f31..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Release & Publish Package - -on: - push: - branches: - - develop - -jobs: - version: - runs-on: ubuntu-latest - outputs: - changes: ${{ steps.version.outputs.changes }} # map step output to job output - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - - name: Enable node - uses: actions/setup-node@v3 - with: - node-version: 16 - - # This step will run changeset version, setting the step output to if there were changesets found - - name: Version command - id: version - run: | - yarn - yarn changeset version - # Push the updated package.json, and CHANGESET.md files to github, this will trigger a new build - # the || echo 'No changes' is to ignore errors from git when trying to commit and there are no changes - - name: Push changes - run: | - git config user.email cicd@xdefi.io - git config user.name "cicd" - git add -A - git commit -m "Version packages" || echo "No changes to commit" - git push - - publish-gpr: - runs-on: ubuntu-latest - needs: version - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Setup user - run: | - git config user.email cicd@xdefi.io - git config user.name "cicd" - - - name: Creating .npmrc - run: | - echo //npm.pkg.github.com/:_authToken=${{ secrets.PKG_TOKEN }} >> "$HOME/.npmrc" - echo @xdefi-tech:registry=https://npm.pkg.github.com/ >> "$HOME/.npmrc" - - - name: Cat .npmrc - run: cat "$HOME/.npmrc" - - - name: Install Dependencies - run: yarn - - name: Build Package - run: yarn build - - name: Publish packages - uses: changesets/action@v1 - with: - publish: yarn changeset publish - setupgituser: false - env: - GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} - NPM_TOKEN: ${{ secrets.PKG_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.PKG_TOKEN }} - diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 62d45d35..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test Package - -on: pull_request - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - - name: Enable node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install dependencies - run: yarn - - - name: Setup Python for Deps - run: sudo apt-get update && sudo apt-get install python3-dev -y - - - name: Build - run: yarn build - - - name: Run tests - run: yarn test From 7d442a24ac3cf22d1f8887a0c4d291f9c22898fd Mon Sep 17 00:00:00 2001 From: abhishek jha Date: Thu, 4 Apr 2024 11:30:53 +0530 Subject: [PATCH 2/3] Removed workflows --- .github/workflows/release.yml | 76 ----------------------------------- .github/workflows/tests.yml | 34 ---------------- 2 files changed, 110 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ea6910ce..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Release & Publish Package - -on: - push: - branches: - - develop - -jobs: - version: - runs-on: ubuntu-latest - outputs: - changes: ${{ steps.version.outputs.changes }} # map step output to job output - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - - name: Enable node - uses: actions/setup-node@v4 - with: - node-version: 20 - - # This step will run changeset version, setting the step output to if there were changesets found - - name: Version command - id: version - run: | - yarn - yarn changeset version - # Push the updated package.json, and CHANGESET.md files to github, this will trigger a new build - # the || echo 'No changes' is to ignore errors from git when trying to commit and there are no changes - - name: Push changes - run: | - git config user.email cicd@xdefi.io - git config user.name "cicd" - git add -A - git commit -m "Version packages" || echo "No changes to commit" - git push - - publish-gpr: - runs-on: ubuntu-latest - needs: version - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Setup user - run: | - git config user.email cicd@xdefi.io - git config user.name "cicd" - - - name: Creating .npmrc - run: | - echo //npm.pkg.github.com/:_authToken=${{ secrets.PKG_TOKEN }} >> "$HOME/.npmrc" - echo @xdefi-tech:registry=https://npm.pkg.github.com/ >> "$HOME/.npmrc" - - - name: Cat .npmrc - run: cat "$HOME/.npmrc" - - - name: Install Dependencies - run: yarn - - name: Build Package - run: yarn build --concurrency 2 - - name: Publish packages - uses: changesets/action@v1 - with: - publish: yarn changeset publish - setupgituser: false - env: - GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} - NPM_TOKEN: ${{ secrets.PKG_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.PKG_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index d63cc9f0..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Test Package - -on: pull_request - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_TOKEN }} - - - name: Enable node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install dependencies - run: yarn - - - name: Setup Python for Deps - run: sudo apt-get update && sudo apt-get install python3-dev -y - - - name: Build - run: yarn build --concurrency 2 - - - name: Run tests - run: yarn test --concurrency 2 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - env: - token: ${{ secrets.CODECOV_TOKEN }} - slug: XDeFi-tech/chains From f7c015bb9e1ec102cfba69b54acf48b3e8ea67a1 Mon Sep 17 00:00:00 2001 From: abhishekgotoadmin <87097447+abhishekgotoadmin@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:24:02 +0530 Subject: [PATCH 3/3] Create release.yml --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..cd3af9c5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Node.js Package + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish-gpr: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLIC_PUBLISH_TOKEN}}