From 6e98497d85adcbf13691334a191b4817ecae9de8 Mon Sep 17 00:00:00 2001 From: Grace Goheen Date: Tue, 13 Jun 2023 11:34:52 -0700 Subject: [PATCH 1/4] add publish workflow --- .github/workflows/publish.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f23e907 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: Publish +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: 3.11 + + - name: Install dependencies and build + run: | + python3 -m pip install --upgrade pip + pip install poetry + poetry build + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + path: ./dist + + pypi-publish: + needs: ['build'] + environment: 'PypiProd' + + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/download-artifact@v3 + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages_dir: artifact/ \ No newline at end of file From 1a85518789954dce0d74f098709b0f026a8e0e35 Mon Sep 17 00:00:00 2001 From: Grace Goheen <53586774+graciegoheen@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:00:26 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Emily Rockman --- .github/workflows/publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f23e907..06f0f0e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,9 +11,9 @@ jobs: uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.9 - name: Install dependencies and build run: | @@ -36,7 +36,8 @@ jobs: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write steps: - - uses: actions/download-artifact@v3 + - name: Download artifacts + uses: actions/download-artifact@v3 - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From 023bd0f69d8fbb5f08e30c28eb9a5ebeea66596a Mon Sep 17 00:00:00 2001 From: Grace Goheen <53586774+graciegoheen@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:14:29 -0700 Subject: [PATCH 3/4] Update .github/workflows/publish.yml --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 06f0f0e..dfd10a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,7 @@ name: Publish on: - push: - tags: - - '*' + release: + types: [created] jobs: build: runs-on: ubuntu-latest From 3268e28acfe1b9305a4af37293ff8626c85708f5 Mon Sep 17 00:00:00 2001 From: Grace Goheen <53586774+graciegoheen@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:15:48 -0700 Subject: [PATCH 4/4] Apply suggestions from code review --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dfd10a7..af8188a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,9 @@ name: Publish + on: release: types: [created] + jobs: build: runs-on: ubuntu-latest