From 719768635185164fab86d5a4f316fbf56c7edf92 Mon Sep 17 00:00:00 2001 From: Devon Stewart Date: Mon, 22 Jul 2024 12:31:31 -0700 Subject: [PATCH] chore/publish attempt #3 (#18) * Makefile expects to be running inside a Repl, sidestep that * Update release-drafter triggers - master -> main - Add the abiliy to manually run * Permit manually triggering release flow --- .github/workflows/python-publish.yml | 13 +++++++++++-- .github/workflows/release-drafter.yml | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4eea666..91f2b82 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -6,6 +6,11 @@ name: Upload Python Package on: release: types: [published] + workflow_dispatch: + inputs: + version: + description: 'What version to use for the release' + required: true jobs: deploy: @@ -27,7 +32,10 @@ jobs: - name: Set release version run: | - tag="${GITHUB_REF_NAME}" + tag="${{ github.event.inputs.version }}" + if [ -z "$tag" ]; then + tag="${GITHUB_REF_NAME}" + fi version="${tag#v}" # Strip leading v # Bump poetry tag @@ -35,6 +43,7 @@ jobs: - name: Build and publish run: | + poetry build TWINE_USERNAME=__token__ \ TWINE_PASSWORD="${{ secrets.PYPI_TOKEN }}" \ - make release + poetry run twine upload dist/* diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 3ff52da..017ce45 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,10 +1,11 @@ name: Release Drafter on: + workflow_dispatch: {} push: # branches to consider in the event; optional, defaults to all branches: - - master + - main # pull_request event is required only for autolabeler pull_request: # Only following types are handled by the action, but one can default to all as well