|
14 | 14 | DENO_DIR: .deno |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - prepare: |
| 17 | + run: |
18 | 18 | runs-on: ubuntu-latest |
19 | 19 |
|
20 | 20 | steps: |
@@ -61,117 +61,23 @@ jobs: |
61 | 61 | - name: Deno Info |
62 | 62 | run: npx deno-bin info |
63 | 63 |
|
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 | | -
|
92 | 64 | - name: Lint TypeScript Code |
93 | 65 | run: npm run lint |
94 | 66 |
|
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 | | -
|
114 | 67 | - name: Test TypeScript Code |
115 | 68 | run: npm run test |
116 | 69 |
|
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 | | -
|
136 | 70 | - name: Compile TypeScript into JavaScript |
137 | 71 | run: npm run compile |
138 | 72 |
|
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 | | -
|
169 | 73 | - name: Authenticate with registry |
| 74 | + if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' |
170 | 75 | env: |
171 | 76 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
172 | 77 | run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc |
173 | 78 |
|
174 | 79 | - name: Publish package |
| 80 | + if: github.event_name == 'release' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' |
175 | 81 | run: | |
176 | 82 | if [[ '${{ github.event_name }}' = 'release' ]]; then |
177 | 83 | npm publish --tag latest |
|
0 commit comments