From 47be9b6ef4c84201bb4aab8b0a910593782982d4 Mon Sep 17 00:00:00 2001 From: Kyle D Date: Fri, 17 Feb 2023 19:54:52 -0700 Subject: [PATCH] Add ci build and deploy --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..20c6181 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Publish py-allspice 📦 to PyPI + +on: + push: + tags: + - 'v*.*' + +jobs: + build-n-publish: + name: Build and py-allspice 📦 to PyPI + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install pypa/setuptools + run: >- + python -m + pip install wheel + - name: Extract tag name + id: tag + run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3 | sed -e 's/v//1') + - name: Update version in setup.py + run: >- + sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py + - name: Build a binary wheel + run: >- + python setup.py sdist bdist_wheel + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file