From cb1bf4930a315ddea1767cfba8767be7f39b471d Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Tue, 21 Nov 2023 16:09:35 -0800 Subject: [PATCH 1/4] Add GitHub action for opensearch-py release Signed-off-by: Zelin Hao --- .github/workflows/release-drafter.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 3c17bc3e..fd570fc5 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -40,3 +40,23 @@ jobs: generate_release_notes: true files: | artifacts.tar.gz + - name: upload windows dists + uses: actions/upload-artifact@v3 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - draft-a-release + permissions: + id-token: write + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v3 + with: + name: release-dists + path: dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 6eabe217c7e85c5cc4a2d71ca21cfaae07110850 Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Wed, 22 Nov 2023 15:24:58 -0800 Subject: [PATCH 2/4] Generate GitHub release at the end Signed-off-by: Zelin Hao --- .github/workflows/release-drafter.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index fd570fc5..fe8cb0ca 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -32,14 +32,6 @@ jobs: - name: Build project for distribution run: | python -m build - tar -zvcf artifacts.tar.gz dist - - name: Release - uses: softprops/action-gh-release@v1 - with: - draft: true - generate_release_notes: true - files: | - artifacts.tar.gz - name: upload windows dists uses: actions/upload-artifact@v3 with: @@ -52,11 +44,21 @@ jobs: - draft-a-release permissions: id-token: write + contents: write steps: - name: Retrieve release distributions uses: actions/download-artifact@v3 with: name: release-dists path: dist + - name: Generate the artifacts + run: | + tar -zvcf artifacts.tar.gz dist - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + - name: Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + files: | + artifacts.tar.gz From 704645b1ad0ddef2b6ef342d26cbe01cd9531ce1 Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Wed, 22 Nov 2023 15:34:42 -0800 Subject: [PATCH 3/4] Update CHANGELOG Signed-off-by: Zelin Hao --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6f10153..abc87f66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added - Added pylint `line-too-long` and `invalid-name` ([#590](https://github.com/opensearch-project/opensearch-py/pull/590)) - Added pylint `pointless-statement` ([#611](https://github.com/opensearch-project/opensearch-py/pull/611)) +- Update the GHA release workflow with trusted publisher enabled ([#614](https://github.com/opensearch-project/opensearch-py/pull/614)) ### Changed ### Deprecated ### Removed From c7cd359f3ac2324281a6b0c7b8c18954b7760e07 Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Wed, 22 Nov 2023 17:12:37 -0800 Subject: [PATCH 4/4] Update CHANGELOG Signed-off-by: Zelin Hao --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f091f2..0719724a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added pylint `line-too-long` and `invalid-name` ([#590](https://github.com/opensearch-project/opensearch-py/pull/590)) - Added pylint `pointless-statement` ([#611](https://github.com/opensearch-project/opensearch-py/pull/611)) - Added a log collection guide ([#579](https://github.com/opensearch-project/opensearch-py/pull/579)) -- - Update the GHA release workflow with trusted publisher enabled ([#614](https://github.com/opensearch-project/opensearch-py/pull/614)) +- Added GHA release ([#614](https://github.com/opensearch-project/opensearch-py/pull/614)) ### Changed ### Deprecated ### Removed