From 8400ca2e7f744e6d031a7d2f1a04ba072c6c7b4c Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Mon, 24 Jul 2023 03:07:31 +0000 Subject: [PATCH 1/2] add release automation 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 000000000..d60d324b4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: "Publish to PyPI" +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install Dependencies + run: python3 -m pip install build --user + - name: Build Packages + run: python3 -m build --sdist --outdir dist/ . + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + + publish: + needs: build + runs-on: ubuntu-22.04 + environment: + name: release + url: https://pypi.org/project/pytorch-pfn-extras/ + permissions: + id-token: write + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + name: dist + path: dist + - name: Enumerate Files + run: find dist -ls + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 69f64c56ae1c9967f19e3dc623a473d62f4dea8e Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Mon, 24 Jul 2023 05:29:36 +0000 Subject: [PATCH 2/2] remove environment --- .github/workflows/publish.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d60d324b4..845163563 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,9 +27,6 @@ jobs: publish: needs: build runs-on: ubuntu-22.04 - environment: - name: release - url: https://pypi.org/project/pytorch-pfn-extras/ permissions: id-token: write steps: