From dc9edb009d46f53b8d9845b995ad68feafe621ad Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Mon, 27 Sep 2021 14:37:07 +0100 Subject: [PATCH] Add upload workflow + slighlty alter others --- .github/workflows/python-publish.yml | 10 +-------- .github/workflows/run-checks.yml | 2 +- .github/workflows/upload-binaries.yml | 30 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/upload-binaries.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3bfabfc..e7c8e74 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,11 +1,3 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Upload Python Package on: @@ -25,7 +17,7 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install -U pip pip install build - name: Build package run: python -m build diff --git a/.github/workflows/run-checks.yml b/.github/workflows/run-checks.yml index 7afaa3c..eaa16e3 100644 --- a/.github/workflows/run-checks.yml +++ b/.github/workflows/run-checks.yml @@ -1,4 +1,4 @@ -name: Run checks +name: Run Checks on: workflow_dispatch: diff --git a/.github/workflows/upload-binaries.yml b/.github/workflows/upload-binaries.yml new file mode 100644 index 0000000..079c432 --- /dev/null +++ b/.github/workflows/upload-binaries.yml @@ -0,0 +1,30 @@ +name: Upload binaries + +on: + release: + types: [published, prereleased] + +jobs: + build: + name: Publish binaries + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install -U pip + pip install build + - name: Build + run: python -m build + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true