|
1 | | -name: Release Installers |
| 1 | +name: Release Cargo and Installer Packages |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | tags: |
6 | | - - 'v*' # Trigger on version tags (e.g., v0.1.0) |
7 | | - workflow_dispatch: # Allow manual triggering |
| 6 | + - "v*" # Trigger on version tags (e.g., v0.1.0) |
| 7 | + workflow_dispatch: # Allow manual triggering |
8 | 8 |
|
9 | 9 | env: |
10 | 10 | CARGO_TERM_COLOR: always |
|
21 | 21 | - name: Install Node.js |
22 | 22 | uses: actions/setup-node@v4 |
23 | 23 | with: |
24 | | - node-version: '20' |
| 24 | + node-version: "20" |
25 | 25 |
|
26 | 26 | - name: Install tree-sitter-cli |
27 | 27 | run: npm install -g tree-sitter-cli |
|
75 | 75 | - name: Install Node.js |
76 | 76 | uses: actions/setup-node@v4 |
77 | 77 | with: |
78 | | - node-version: '20' |
| 78 | + node-version: "20" |
79 | 79 |
|
80 | 80 | - name: Install tree-sitter-cli |
81 | 81 | run: npm install -g tree-sitter-cli |
@@ -125,7 +125,7 @@ jobs: |
125 | 125 | - name: Install Node.js |
126 | 126 | uses: actions/setup-node@v4 |
127 | 127 | with: |
128 | | - node-version: '20' |
| 128 | + node-version: "20" |
129 | 129 |
|
130 | 130 | - name: Install tree-sitter-cli |
131 | 131 | run: npm install -g tree-sitter-cli |
@@ -167,9 +167,61 @@ jobs: |
167 | 167 | path: src/target/release/packager/*.deb |
168 | 168 | retention-days: 30 |
169 | 169 |
|
| 170 | + build-cargo: |
| 171 | + name: Publish to crates.io |
| 172 | + runs-on: ubuntu-latest |
| 173 | + permissions: |
| 174 | + id-token: write |
| 175 | + contents: read |
| 176 | + |
| 177 | + steps: |
| 178 | + - name: Checkout code |
| 179 | + uses: actions/checkout@v4 |
| 180 | + |
| 181 | + - name: Install Node.js |
| 182 | + uses: actions/setup-node@v4 |
| 183 | + with: |
| 184 | + node-version: "20" |
| 185 | + |
| 186 | + - name: Install tree-sitter-cli |
| 187 | + run: npm install -g tree-sitter-cli |
| 188 | + |
| 189 | + - name: Install Rust toolchain |
| 190 | + uses: dtolnay/rust-toolchain@stable |
| 191 | + |
| 192 | + - name: Rust cache |
| 193 | + uses: Swatinem/rust-cache@v2 |
| 194 | + with: |
| 195 | + shared-key: cargo-publish |
| 196 | + |
| 197 | + - name: Get crates.io publish token |
| 198 | + uses: rust-lang/crates-io-auth-action@v1 |
| 199 | + id: auth |
| 200 | + |
| 201 | + - name: Publish tree-sitter-ggsql |
| 202 | + run: cargo publish --package tree-sitter-ggsql |
| 203 | + env: |
| 204 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
| 205 | + |
| 206 | + - name: Wait for crates.io index update |
| 207 | + run: sleep 30 |
| 208 | + |
| 209 | + - name: Publish ggsql |
| 210 | + run: cargo publish --package ggsql |
| 211 | + env: |
| 212 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
| 213 | + |
| 214 | + - name: Wait for crates.io index update |
| 215 | + run: sleep 30 |
| 216 | + |
| 217 | + - name: Publish ggsql-jupyter |
| 218 | + run: cargo publish --package ggsql-jupyter |
| 219 | + env: |
| 220 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
| 221 | + |
170 | 222 | create-release: |
171 | 223 | name: Create GitHub Release |
172 | | - needs: [build-windows, build-macos, build-linux] |
| 224 | + needs: [build-windows, build-macos, build-linux, build-cargo] |
173 | 225 | runs-on: ubuntu-latest |
174 | 226 | if: startsWith(github.ref, 'refs/tags/v') |
175 | 227 |
|
|
0 commit comments