diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9f65042d3..0978e2f11 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: @@ -47,7 +47,7 @@ jobs: - name: Cache node modules id: cache-nodemodules - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ./node_modules @@ -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