From 74e5af540f4477570dd6ea5f4f7955e037a74ea0 Mon Sep 17 00:00:00 2001 From: Kevin Valk Date: Wed, 21 Feb 2024 12:05:34 +0100 Subject: [PATCH] feat: automatic release of the plugin on tagging --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6542dc3..b2b996e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,30 @@ jobs: - run: sqlc diff working-directory: examples - - uses: actions/upload-artifact@v3 + - name: Generate checksum + id: checksum + run: |- + echo "sha256=$(sha256sum bin/sqlc-gen-python.wasm | awk '{ print $1 }')" >> $GITHUB_OUTPUT + + - uses: actions/upload-artifact@v4 with: name: sqlc-gen-python - path: plugin/sqlc-gen-python.wasm \ No newline at end of file + path: bin/sqlc-gen-python.wasm + + - name: Release the build on tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body: | + # Configuration + ```yaml + version: '2' + plugins: + - name: py + wasm: + url: ${{ github.server_url }}/${{ github.repository}}/releases/download/${{ github.ref_name }}/sqlc-gen-python.wasm + sha256: ${{ steps.checksum.outputs.sha256 }} + ``` + generate_release_notes: true + files: | + bin/sqlc-gen-python.wasm \ No newline at end of file