From e95e51958045c29a536901c237ad7fe7b64b12f3 Mon Sep 17 00:00:00 2001 From: Denis Rossati Ramos Date: Mon, 30 Mar 2026 16:00:31 -0300 Subject: [PATCH 1/3] Use reusable workflows --- .github/workflows/branch-validations.yaml | 100 ++---------------- .../workflows/deploy-published-releases.yaml | 61 +++-------- 2 files changed, 19 insertions(+), 142 deletions(-) diff --git a/.github/workflows/branch-validations.yaml b/.github/workflows/branch-validations.yaml index c1d68848..f2111b2f 100644 --- a/.github/workflows/branch-validations.yaml +++ b/.github/workflows/branch-validations.yaml @@ -12,97 +12,9 @@ on: - opened jobs: - security-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - registry-url: 'https://registry.npmjs.org' - node-version: 23 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - with: - path: node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check dependency vulnerabilities - run: npm audit --omit=dev - - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - with: - path: node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check compilation errors - run: npm run validate - - lint: - runs-on: ubuntu-latest - needs: - - validate - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - with: - path: node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check coding standard violations - run: npm run lint - - test: - runs-on: ubuntu-latest - needs: - - validate - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - with: - path: node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Run tests - run: npm run test + validations: + uses: croct-tech/github-workflows/.github/workflows/general/javascript-validations.yml@unify-workflows + with: + node-version: '23' + run-security: true + use-private-registry: false diff --git a/.github/workflows/deploy-published-releases.yaml b/.github/workflows/deploy-published-releases.yaml index 07868817..bf6f6311 100644 --- a/.github/workflows/deploy-published-releases.yaml +++ b/.github/workflows/deploy-published-releases.yaml @@ -7,51 +7,16 @@ on: jobs: deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - registry-url: 'https://registry.npmjs.org' - node-version: 23 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - with: - path: node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Build package - run: npm run build - - - name: Prepare release - run: |- - cp LICENSE README.md build/ - cd build - find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} + - sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json - sed -i -e "s~\./build~.~" package.json - sed -i -e "s~./src~.~" package.json - - - name: Publish pre-release to NPM - if: ${{ github.event.release.prerelease }} - run: |- - cd build - npm publish --access public --tag next - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish release to NPM - if: ${{ !github.event.release.prerelease }} - run: |- - cd build - npm publish --access public - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + uses: croct-tech/github-workflows/.github/workflows/general/publish-npm-package.yml@unify-workflows + with: + node-version: "23" + publish-access: "public" + prepare-script: >- + cp LICENSE README.md build/ && + cd build && + find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} + && + sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json && + sed -i -e "s~\./build~.~" package.json && + sed -i -e "s~./src~.~" package.json + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 40b6c42fd7535b851aac33e5f4ee3da4fe17bc30 Mon Sep 17 00:00:00 2001 From: Denis Rossati Ramos Date: Wed, 1 Apr 2026 16:09:35 -0300 Subject: [PATCH 2/3] Update workflow --- .github/workflows/branch-validations.yaml | 2 +- .github/workflows/deploy-published-releases.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-validations.yaml b/.github/workflows/branch-validations.yaml index f2111b2f..8e9fefb0 100644 --- a/.github/workflows/branch-validations.yaml +++ b/.github/workflows/branch-validations.yaml @@ -13,7 +13,7 @@ on: jobs: validations: - uses: croct-tech/github-workflows/.github/workflows/general/javascript-validations.yml@unify-workflows + uses: croct-tech/github-workflows/.github/workflows/javascript-validation.yml@unify-workflows with: node-version: '23' run-security: true diff --git a/.github/workflows/deploy-published-releases.yaml b/.github/workflows/deploy-published-releases.yaml index bf6f6311..3a84115e 100644 --- a/.github/workflows/deploy-published-releases.yaml +++ b/.github/workflows/deploy-published-releases.yaml @@ -7,7 +7,7 @@ on: jobs: deploy: - uses: croct-tech/github-workflows/.github/workflows/general/publish-npm-package.yml@unify-workflows + uses: croct-tech/github-workflows/.github/workflows/publish-npm-package.yml@unify-workflows with: node-version: "23" publish-access: "public" From 65785e9dda757571d3bfa54e43805eb1fd2f435a Mon Sep 17 00:00:00 2001 From: Denis Rossati Ramos Date: Mon, 6 Apr 2026 15:43:02 -0300 Subject: [PATCH 3/3] Set default node version --- .github/workflows/branch-validations.yaml | 3 +-- .github/workflows/deploy-published-releases.yaml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/branch-validations.yaml b/.github/workflows/branch-validations.yaml index 8e9fefb0..f2c4ba11 100644 --- a/.github/workflows/branch-validations.yaml +++ b/.github/workflows/branch-validations.yaml @@ -13,8 +13,7 @@ on: jobs: validations: - uses: croct-tech/github-workflows/.github/workflows/javascript-validation.yml@unify-workflows + uses: croct-tech/renovate-public-presets/.github/workflows/javascript-validations.yml@unify-workflows with: - node-version: '23' run-security: true use-private-registry: false diff --git a/.github/workflows/deploy-published-releases.yaml b/.github/workflows/deploy-published-releases.yaml index 3a84115e..7c200879 100644 --- a/.github/workflows/deploy-published-releases.yaml +++ b/.github/workflows/deploy-published-releases.yaml @@ -9,7 +9,6 @@ jobs: deploy: uses: croct-tech/github-workflows/.github/workflows/publish-npm-package.yml@unify-workflows with: - node-version: "23" publish-access: "public" prepare-script: >- cp LICENSE README.md build/ &&