|
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - "v*" |
| 7 | + pull_request: |
| 8 | + branches: [main] |
7 | 9 | workflow_dispatch: |
8 | 10 |
|
9 | 11 | env: |
@@ -169,81 +171,3 @@ jobs: |
169 | 171 | name: ggsql-linux-deb |
170 | 172 | path: target/release/packager/*.deb |
171 | 173 | retention-days: 30 |
172 | | - |
173 | | - build-cargo: |
174 | | - name: Publish to crates.io |
175 | | - runs-on: ubuntu-latest |
176 | | - permissions: |
177 | | - id-token: write |
178 | | - contents: read |
179 | | - |
180 | | - steps: |
181 | | - - name: Checkout code |
182 | | - uses: actions/checkout@v4 |
183 | | - |
184 | | - - name: Install Node.js |
185 | | - uses: actions/setup-node@v4 |
186 | | - with: |
187 | | - node-version: "22" |
188 | | - |
189 | | - - name: Install tree-sitter-cli |
190 | | - run: npm install -g tree-sitter-cli |
191 | | - |
192 | | - - name: Install Rust toolchain |
193 | | - uses: dtolnay/rust-toolchain@stable |
194 | | - |
195 | | - - name: Get crates.io publish token |
196 | | - uses: rust-lang/crates-io-auth-action@v1 |
197 | | - id: auth |
198 | | - |
199 | | - - name: Build tree-sitter-ggsql |
200 | | - run: cargo build --package tree-sitter-ggsql |
201 | | - |
202 | | - - name: Publish tree-sitter-ggsql |
203 | | - run: cargo publish --package tree-sitter-ggsql --allow-dirty |
204 | | - env: |
205 | | - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
206 | | - |
207 | | - - name: Wait for crates.io index update |
208 | | - run: sleep 30 |
209 | | - |
210 | | - - name: Publish ggsql |
211 | | - run: cargo publish --package ggsql |
212 | | - env: |
213 | | - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
214 | | - |
215 | | - - name: Wait for crates.io index update |
216 | | - run: sleep 30 |
217 | | - |
218 | | - - name: Publish ggsql-jupyter |
219 | | - run: cargo publish --package ggsql-jupyter |
220 | | - env: |
221 | | - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
222 | | - |
223 | | - create-release: |
224 | | - name: Create GitHub Release |
225 | | - needs: [build-windows, build-macos, build-linux, build-cargo] |
226 | | - runs-on: ubuntu-latest |
227 | | - permissions: |
228 | | - contents: write |
229 | | - if: startsWith(github.ref, 'refs/tags/v') |
230 | | - |
231 | | - steps: |
232 | | - - name: Download all artifacts |
233 | | - uses: actions/download-artifact@v4 |
234 | | - with: |
235 | | - path: artifacts |
236 | | - |
237 | | - - name: Display structure of downloaded files |
238 | | - run: ls -R artifacts |
239 | | - |
240 | | - - name: Create release and upload installers |
241 | | - uses: softprops/action-gh-release@v2 |
242 | | - with: |
243 | | - files: | |
244 | | - artifacts/**/*.exe |
245 | | - artifacts/**/*.msi |
246 | | - artifacts/**/*.dmg |
247 | | - artifacts/**/*.deb |
248 | | - env: |
249 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments