diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..baff34a --- /dev/null +++ b/.github/workflows/release.yml @@ -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') }} + 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 + 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 + diff --git a/pyproject.toml b/pyproject.toml index 65b209d..cfdb03c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ionic-langchain" -version = "0.1.2" +version = "0.1.3" description = "" authors = ["Owen Sims "] readme = "README.md"