From fb4f4f057acd6ee793ea983aa803dbf0ef1397ee Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:30:13 +0800 Subject: [PATCH 01/12] create release workflow --- .github/workflows/release.yaml | 33 ++++++++++ .idea/.gitignore | 8 +++ .idea/deployment.xml | 14 +++++ .idea/inspectionProfiles/Project_Default.xml | 63 ++++++++++++++++++++ .idea/modules.xml | 8 +++ .idea/sqlc-gen-python-orm.iml | 9 +++ .idea/vcs.xml | 6 ++ 7 files changed, 141 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .idea/.gitignore create mode 100644 .idea/deployment.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/sqlc-gen-python-orm.iml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..01e112f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: make + +on: + release: + types: [published] + +jobs: + release: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21.0' + + - run: make dist/sqlc-gen-python-orm.wasm + - run: make dist/sqlc-gen-python-orm.wasm + + - run: | + SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) + cat > release.md <<- EOF + plugins: + - name: py + wasm: + url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm + sha256: ${SHA256} + EOF + + - name: Upload Github Release + run: gh release create "${GITHUB_REF}" --notes --notes-file release.md dist/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..1c716f7 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..35bca26 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,63 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f03ffe3 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/sqlc-gen-python-orm.iml b/.idea/sqlc-gen-python-orm.iml new file mode 100644 index 0000000..338a266 --- /dev/null +++ b/.idea/sqlc-gen-python-orm.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c8397c9 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 1188de01cb9e5f604d4d8402676f4b51008b93ec Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:30:50 +0800 Subject: [PATCH 02/12] more --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 01e112f..c139452 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,11 +20,13 @@ jobs: - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) cat > release.md <<- EOF + ``` plugins: - name: py wasm: url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm sha256: ${SHA256} + ``` EOF - name: Upload Github Release From 8285aacdb0ac4ec6a8bd7ffa5901917d409ea496 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:31:21 +0800 Subject: [PATCH 03/12] Delete .idea directory --- .idea/.gitignore | 8 --- .idea/deployment.xml | 14 ----- .idea/inspectionProfiles/Project_Default.xml | 63 -------------------- .idea/modules.xml | 8 --- .idea/sqlc-gen-python-orm.iml | 9 --- .idea/vcs.xml | 6 -- 6 files changed, 108 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/deployment.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/sqlc-gen-python-orm.iml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 35410ca..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# 默认忽略的文件 -/shelf/ -/workspace.xml -# 基于编辑器的 HTTP 客户端请求 -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/deployment.xml b/.idea/deployment.xml deleted file mode 100644 index 1c716f7..0000000 --- a/.idea/deployment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 35bca26..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index f03ffe3..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/sqlc-gen-python-orm.iml b/.idea/sqlc-gen-python-orm.iml deleted file mode 100644 index 338a266..0000000 --- a/.idea/sqlc-gen-python-orm.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index c8397c9..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 574618ddf8e8a18d110d443289992ba32b6d6e7a Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:33:13 +0800 Subject: [PATCH 04/12] update --- .github/workflows/release.yaml | 5 +++-- .gitignore | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c139452..70bb886 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,8 +1,9 @@ name: make on: - release: - types: [published] + push: + tags: + - 'v*' jobs: release: diff --git a/.gitignore b/.gitignore index 53c37a1..df8497b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -dist \ No newline at end of file +dist +.idea/ +.vscode/ From dc29469a2cdbe08abe6b9baf6c8ea2030f1869ae Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:34:02 +0800 Subject: [PATCH 05/12] fix --- .github/workflows/release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 70bb886..ba51f39 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,6 @@ jobs: go-version: '1.21.0' - run: make dist/sqlc-gen-python-orm.wasm - - run: make dist/sqlc-gen-python-orm.wasm - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) From 3cb3e364566accc9ea9dc907c280a5e5ebc69322 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:35:52 +0800 Subject: [PATCH 06/12] fix --- .github/workflows/ci.yml | 6 +++++- .github/workflows/release.yaml | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2779fd5..e0812e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: branches: - main pull_request: + +env: + GOTOOLCHAIN: local + jobs: build: name: test @@ -12,5 +16,5 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.0' + go-version: '1.21' - run: make diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ba51f39..236ed14 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,9 @@ on: tags: - 'v*' +env: + GOTOOLCHAIN: local + jobs: release: name: test @@ -13,9 +16,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.0' + go-version: '1.21' - - run: make dist/sqlc-gen-python-orm.wasm + - run: make dist/sqlc-gen-python-orm.wasm.sha256 - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) From 3f0c350a9dc3e5126f85b64c7fe798955e64ae1b Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:36:36 +0800 Subject: [PATCH 07/12] fix --- .github/workflows/release.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 236ed14..9694841 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,13 +23,13 @@ jobs: - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) cat > release.md <<- EOF - ``` - plugins: - - name: py - wasm: - url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm - sha256: ${SHA256} - ``` + "```" + "plugins:" + "- name: py" + "wasm:" + " url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" + " sha256: ${SHA256}" + "```" EOF - name: Upload Github Release From 76b40606d621a1e6c0b8bd1c8a8ec16ba2877d0c Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:36:57 +0800 Subject: [PATCH 08/12] fix --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9694841..dd34cbe 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,6 +33,6 @@ jobs: EOF - name: Upload Github Release - run: gh release create "${GITHUB_REF}" --notes --notes-file release.md dist/* + run: gh release create "${GITHUB_REF}" --notes-file release.md dist/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ddd967ebe49d71f1c7231410ed631bca573bb831 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:40:00 +0800 Subject: [PATCH 09/12] fix --- .github/workflows/release.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dd34cbe..d079cb0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,15 +22,15 @@ jobs: - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) - cat > release.md <<- EOF - "```" - "plugins:" - "- name: py" - "wasm:" - " url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" - " sha256: ${SHA256}" - "```" - EOF + + echo '```' | tee -a release.md + echo "plugins:" | tee -a release.md + echo "- name: py" | tee -a release.md + echo "wasm:" | tee -a release.md + echo " url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" | tee -a release.md + echo " sha256: ${SHA256}" | tee -a release.md + echo '```' | tee -a release.md + - name: Upload Github Release run: gh release create "${GITHUB_REF}" --notes-file release.md dist/* From 46823dc26acc901a0e5fd7d615974a56e474dcc8 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:40:52 +0800 Subject: [PATCH 10/12] fix --- .github/workflows/release.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d079cb0..9c1a330 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,13 +22,14 @@ jobs: - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) + URL="https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" echo '```' | tee -a release.md echo "plugins:" | tee -a release.md echo "- name: py" | tee -a release.md - echo "wasm:" | tee -a release.md - echo " url: https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" | tee -a release.md - echo " sha256: ${SHA256}" | tee -a release.md + echo " wasm:" | tee -a release.md + echo " url: ${URL}" | tee -a release.md + echo " sha256: ${SHA256}" | tee -a release.md echo '```' | tee -a release.md From bc98e1ac161bc1c3b3782fe1611f0c3690ac063c Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:41:43 +0800 Subject: [PATCH 11/12] fix --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9c1a330..a27d254 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: - run: | SHA256=$(cat dist/sqlc-gen-python-orm.wasm.sha256) - URL="https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF}/sqlc-gen-python-orm.wasm" + URL="https://github.com/veltiosoft/sqlc-gen-python-orm/releases/download/${GITHUB_REF_NAME}/sqlc-gen-python-orm.wasm" echo '```' | tee -a release.md echo "plugins:" | tee -a release.md From 7f70b4a3928d0fc9b1e96bb690b92bf7b80c46d2 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 23 Sep 2024 16:43:36 +0800 Subject: [PATCH 12/12] fix --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0812e9..c3799ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,5 +16,5 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.21.0' - run: make diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a27d254..200f833 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.21.0' - run: make dist/sqlc-gen-python-orm.wasm.sha256