Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Commit ba87380

Browse files
authored
ci: remove need for multiple jobs
1 parent 3f39472 commit ba87380

File tree

1 file changed

+3
-97
lines changed

1 file changed

+3
-97
lines changed

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
DENO_DIR: .deno
1515

1616
jobs:
17-
prepare:
17+
run:
1818
runs-on: ubuntu-latest
1919

2020
steps:
@@ -61,117 +61,23 @@ jobs:
6161
- name: Deno Info
6262
run: npx deno-bin info
6363

64-
- name: Prepare workspace
65-
run: |
66-
tar czf /tmp/workspace.tar.gz .
67-
68-
- uses: actions/upload-artifact@v4
69-
with:
70-
name: workspace
71-
path: /tmp/workspace.tar.gz
72-
73-
lint:
74-
runs-on: ubuntu-latest
75-
needs: prepare
76-
77-
steps:
78-
- name: Use Node.js 14.19.3
79-
uses: actions/setup-node@v2
80-
with:
81-
node-version: '14.19.3'
82-
83-
- uses: actions/download-artifact@v4
84-
with:
85-
name: workspace
86-
path: /tmp
87-
88-
- name: Decompress workspace
89-
run: |
90-
tar xzf /tmp/workspace.tar.gz .
91-
9264
- name: Lint TypeScript Code
9365
run: npm run lint
9466

95-
test:
96-
runs-on: ubuntu-latest
97-
needs: build
98-
99-
steps:
100-
- name: Use Node.js 14.19.3
101-
uses: actions/setup-node@v2
102-
with:
103-
node-version: '14.19.3'
104-
105-
- uses: actions/download-artifact@v4
106-
with:
107-
name: workspace
108-
path: /tmp
109-
110-
- name: Decompress workspace
111-
run: |
112-
tar xzf /tmp/workspace.tar.gz .
113-
11467
- name: Test TypeScript Code
11568
run: npm run test
11669

117-
build:
118-
runs-on: ubuntu-latest
119-
needs: lint
120-
121-
steps:
122-
- name: Use Node.js 14.19.3
123-
uses: actions/setup-node@v2
124-
with:
125-
node-version: '14.19.3'
126-
127-
- uses: actions/download-artifact@v4
128-
with:
129-
name: workspace
130-
path: /tmp
131-
132-
- name: Decompress workspace
133-
run: |
134-
tar xzf /tmp/workspace.tar.gz .
135-
13670
- name: Compile TypeScript into JavaScript
13771
run: npm run compile
13872

139-
- name: Prepare workspace
140-
run: |
141-
tar czf /tmp/workspace.tar.gz .
142-
143-
- uses: actions/upload-artifact@v4
144-
with:
145-
name: workspace
146-
path: /tmp/workspace.tar.gz
147-
overwrite: true
148-
149-
publish:
150-
runs-on: ubuntu-latest
151-
if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta'
152-
needs: test
153-
154-
steps:
155-
- name: Use Node.js 14.19.3
156-
uses: actions/setup-node@v2
157-
with:
158-
node-version: '14.19.3'
159-
160-
- uses: actions/download-artifact@v4
161-
with:
162-
name: workspace
163-
path: /tmp
164-
165-
- name: Decompress workspace
166-
run: |
167-
tar xzf /tmp/workspace.tar.gz .
168-
16973
- name: Authenticate with registry
74+
if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta'
17075
env:
17176
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
17277
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
17378

17479
- name: Publish package
80+
if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta'
17581
run: |
17682
if [[ '${{ github.event_name }}' = 'release' ]]; then
17783
npm publish --tag latest

0 commit comments

Comments
 (0)