From ba8738013dcc9033b347ea5e73f5b49d5c748c6d Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Fri, 4 Apr 2025 23:00:19 +0530 Subject: [PATCH 1/2] ci: remove need for multiple jobs --- .github/workflows/build_and_test.yml | 100 +-------------------------- 1 file changed, 3 insertions(+), 97 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9f65042d3..8a97d446d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,7 +14,7 @@ env: DENO_DIR: .deno jobs: - prepare: + run: runs-on: ubuntu-latest steps: @@ -61,117 +61,23 @@ jobs: - name: Deno Info run: npx deno-bin info - - name: Prepare workspace - run: | - tar czf /tmp/workspace.tar.gz . - - - uses: actions/upload-artifact@v4 - with: - name: workspace - path: /tmp/workspace.tar.gz - - lint: - runs-on: ubuntu-latest - needs: prepare - - steps: - - name: Use Node.js 14.19.3 - uses: actions/setup-node@v2 - with: - node-version: '14.19.3' - - - uses: actions/download-artifact@v4 - with: - name: workspace - path: /tmp - - - name: Decompress workspace - run: | - tar xzf /tmp/workspace.tar.gz . - - name: Lint TypeScript Code run: npm run lint - test: - runs-on: ubuntu-latest - needs: build - - steps: - - name: Use Node.js 14.19.3 - uses: actions/setup-node@v2 - with: - node-version: '14.19.3' - - - uses: actions/download-artifact@v4 - with: - name: workspace - path: /tmp - - - name: Decompress workspace - run: | - tar xzf /tmp/workspace.tar.gz . - - name: Test TypeScript Code run: npm run test - build: - runs-on: ubuntu-latest - needs: lint - - steps: - - name: Use Node.js 14.19.3 - uses: actions/setup-node@v2 - with: - node-version: '14.19.3' - - - uses: actions/download-artifact@v4 - with: - name: workspace - path: /tmp - - - name: Decompress workspace - run: | - tar xzf /tmp/workspace.tar.gz . - - name: Compile TypeScript into JavaScript run: npm run compile - - name: Prepare workspace - run: | - tar czf /tmp/workspace.tar.gz . - - - uses: actions/upload-artifact@v4 - with: - name: workspace - path: /tmp/workspace.tar.gz - overwrite: true - - publish: - runs-on: ubuntu-latest - if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' - needs: test - - steps: - - name: Use Node.js 14.19.3 - uses: actions/setup-node@v2 - with: - node-version: '14.19.3' - - - uses: actions/download-artifact@v4 - with: - name: workspace - path: /tmp - - - name: Decompress workspace - run: | - tar xzf /tmp/workspace.tar.gz . - - name: Authenticate with registry + if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - name: Publish package + if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' run: | if [[ '${{ github.event_name }}' = 'release' ]]; then npm publish --tag latest From f781f7aa3bbf95bc25bdf26702538578b4e5a723 Mon Sep 17 00:00:00 2001 From: Julio Araujo Date: Tue, 8 Apr 2025 22:44:39 +0200 Subject: [PATCH 2/2] Change cache version since v2 was deprecated --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8a97d446d..0978e2f11 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -47,7 +47,7 @@ jobs: - name: Cache node modules id: cache-nodemodules - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ./node_modules