Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
workflow_dispatch:
jobs:
publish-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Ensure valid tag reference
if: ${{ github.ref_type != 'tag' }} || ${{ !startsWith(github.ref_name, 'v') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to make testing it from a PR tough so maybe I should hold off on this check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding --dry-run to the poetry publish command would help with testing https://python-poetry.org/docs/cli/#options-8

Copy link
Contributor Author

@gmkohler gmkohler Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uses: actions/github-script@v7
with:
script: |
core.notice('you can only run the publish workflow from a release tag (vX.Y.Z)')
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up python
uses: actions/setup-python@v4
with:
python-version-file: .python-version
- name: Install Poetry
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need to source this at some point?

uses: snok/install-poetry@v1
with:
version: "1.6.1"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: output library version
id: output-version
# prefix with v to match tag convention
run: poetry version -s | awk '{ print "version=v" $1 }' >> $GITHUB_OUTPUT
- name: check library version
if: ${{ steps.output-version.outputs.version }} != ${{ github.ref }}
id: check-version
uses: actions/github-script@v7
with:
script: |
core.notice('library version does not match the github tag')
- name: Build release
id: build-release
run: poetry build
- name: Publish version to PyPI
id: publish-release
run: poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --dry-run

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ionic-langchain"
version = "0.1.2"
version = "0.1.3"
description = ""
authors = ["Owen Sims <owen@ionicapi.com>"]
readme = "README.md"
Expand Down