From 0813d89a8718f896aaa0c012aaf22c9df425d7ea Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 23 May 2025 19:35:44 +0200 Subject: [PATCH 1/3] Removed 0% test --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bb36f6..ad54b21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,7 @@ jobs: # Create the release body with the warning message at the top echo "> [!WARNING]" > release_body.md - echo "> Every Release before \`v1.0.0\`, including this one is an **early alpha release**. Currently, there is 0% test coverage and these versions are only released for interested people who want to test this plugin and help make it better." >> release_body.md + echo "> Every Release before \`v1.0.0\`, including this one is an **early alpha release**. These versions are only released for interested people who want to test this plugin and help make it better." >> release_body.md # Add the release changelog and YAML content below the warning message cat .changes/${{ steps.latest.outputs.output }}.md >> release_body.md From ba747d1061a89ee686e3012e4f911ffa535cf77e Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 23 May 2025 19:39:38 +0200 Subject: [PATCH 2/3] Update release.yml --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad54b21..5b1777a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,8 @@ jobs: commit-message: "chore: update README example with v${{ steps.latest.outputs.output }}" branch: "release/update-readme-${{ steps.latest.outputs.output }}" title: "Update README for release ${{ steps.latest.outputs.output }}" + add-paths: | + README.md body: | This PR updates the README example config with: - WASM plugin version: `${{ steps.latest.outputs.output }}` @@ -59,10 +61,6 @@ jobs: Auto-generated during the release workflow. - - name: Build plugin again - working-directory: plugin - run: GOOS=wasip1 GOARCH=wasm go build -o ../sqlc-gen-better-python.wasm - - name: Generate release description run: | cd ${{ github.workspace }} From 6cd7c183d82b051a6101a239e5fb772f2112ee51 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 23 May 2025 20:02:12 +0200 Subject: [PATCH 3/3] Update release.yml --- .github/workflows/release.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b1777a..820309f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,12 @@ jobs: working-directory: plugin run: GOOS=wasip1 GOARCH=wasm go build -o ../sqlc-gen-better-python.wasm + - name: Calculate SHA256 hash + id: hash + run: | + HASH=$(sha256sum sqlc-gen-better-python.wasm | awk '{ print $1 }') + echo "sha256=$HASH" >> $GITHUB_OUTPUT + - name: Get the latest version id: latest uses: miniscruff/changie-action@v2 @@ -32,19 +38,17 @@ jobs: args: latest - name: Create tag + id: tag run: | git tag ${{ steps.latest.outputs.output }} git push origin ${{ steps.latest.outputs.output }} + DOWNLOAD_URL="https://github.com/rayakame/sqlc-gen-better-python/releases/download/${{ steps.latest.outputs.output }}/sqlc-gen-better-python.wasm" + echo "download_url=$DOWNLOAD_URL" >> $GITHUB_OUTPUT - name: Update README with new version and checksum run: | - cd ${{ github.workspace }} - version=${{ steps.latest.outputs.output }} - export checksum=$(sha256sum sqlc-gen-better-python.wasm | awk '{print $1}') - export escaped_url="https://github.com/rayakame/sqlc-gen-better-python/releases/download/${version}/sqlc-gen-better-python.wasm" - - sed -i -E "s|(url: ).*|url: ${escaped_url}|" README.md - sed -i -E "s|(sha256: )[a-f0-9]+|\1${checksum}|" README.md + sed -i -E "s|(url: ).*|url: ${{ steps.tag.outputs.download_url }}|" README.md + sed -i -E "s|(sha256: ).*|sha256: ${{ steps.hash.outputs.sha256 }}|" README.md - name: Create PR to update README uses: peter-evans/create-pull-request@v7 @@ -57,18 +61,15 @@ jobs: body: | This PR updates the README example config with: - WASM plugin version: `${{ steps.latest.outputs.output }}` - - SHA256 checksum: `${checksum}` + - SHA256 checksum: `${{ steps.hash.outputs.sha256 }}` Auto-generated during the release workflow. - name: Generate release description run: | - cd ${{ github.workspace }} - export checksum=$(sha256sum sqlc-gen-better-python.wasm | awk '{print $1}') - export download_url="https://github.com/rayakame/sqlc-gen-better-python/releases/download/${{ steps.latest.outputs.output }}/sqlc-gen-better-python.wasm" - yq -i '.plugins[0].wasm.url = env(download_url)' .github/release_output_template.yaml - yq -i '.plugins[0].wasm.sha256 = env(checksum)' .github/release_output_template.yaml + yq -i '.plugins[0].wasm.url = ${{ steps.tag.outputs.download_url }}' .github/release_output_template.yaml + yq -i '.plugins[0].wasm.sha256 = ${{ steps.hash.outputs.sha256 }}' .github/release_output_template.yaml # Create the release body with the warning message at the top echo "> [!WARNING]" > release_body.md