chore: remove drivers other than postgres #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: sqlc-dev/setup-sqlc@v4 | |
| with: | |
| sqlc-version: '1.24.0' | |
| - uses: actions/setup-node@v4 | |
| - run: wget https://github.com/bytecodealliance/javy/releases/download/v4.0.0/javy-x86_64-linux-v4.0.0.gz | |
| - run: gzip -d javy-x86_64-linux-v4.0.0.gz | |
| - run: chmod +x javy-x86_64-linux-v4.0.0 | |
| - run: npm install | |
| - run: npx tsc --noEmit | |
| - run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js | |
| - run: ./javy-x86_64-linux-v4.0.0 build out.js -o examples/plugin.wasm | |
| - run: cp examples/plugin.wasm examples/sqlc-gen-typescript_dev.wasm | |
| - id: calculate_sha256 | |
| run: | | |
| sha256sum examples/sqlc-gen-typescript_dev.wasm > examples/sqlc-gen-typescript_dev.wasm.sha256 | |
| SHA256=$(cat examples/sqlc-gen-typescript_dev.wasm.sha256 | awk '{ print $1 }') | |
| echo "::set-output name=sha256::$SHA256" | |
| - run: sqlc -f sqlc.dev.yaml diff | |
| working-directory: examples | |
| - name: Set outputs | |
| id: vars | |
| run: echo "tag_name=v$(date +'%Y%m%d.%H%M%S')_$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.vars.outputs.tag_name }} | |
| release_name: Nightly Release | |
| draft: false | |
| prerelease: false | |
| - name: Upload Plugin WASM to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: examples/sqlc-gen-typescript_dev.wasm | |
| asset_name: sqlc-gen-typescript_dev.wasm | |
| asset_content_type: application/wasm | |
| - name: Upload Plugin WASM SHA256 to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: examples/sqlc-gen-typescript_dev.wasm.sha256 | |
| asset_name: sqlc-gen-typescript_dev.wasm.sha256 | |
| asset_content_type: text/plain | |
| - name: Update Release Description with SHA256 | |
| uses: actions/github-script@v4 | |
| env: | |
| tag: ${{ steps.vars.outputs.tag_name }} | |
| sha256: ${{ steps.calculate_sha256.outputs.sha256 }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| script: | | |
| const { tag, sha256 } = process.env; | |
| const { data: release } = await github.repos.getReleaseByTag({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag: tag | |
| }); | |
| await github.repos.updateRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: release.id, | |
| body: `\`\`\`yml | |
| plugins: | |
| - name: ts | |
| wasm: | |
| url: https://github.com/eEQK/sqlc-gen-typescript/releases/download/${tag}/sqlc-gen-typescript_dev.wasm | |
| sha256: ${sha256} | |
| \`\`\`` | |
| }); |