Skip to content

Commit

Permalink
chore/publish attempt #3 (#18)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
blast-hardcheese authored Jul 22, 2024
1 parent 90218dc commit 7197686
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -27,14 +32,18 @@ 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
poetry version "$version"
- name: Build and publish
run: |
poetry build
TWINE_USERNAME=__token__ \
TWINE_PASSWORD="${{ secrets.PYPI_TOKEN }}" \
make release
poetry run twine upload dist/*
3 changes: 2 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7197686

Please sign in to comment.