Skip to content

Commit

Permalink
Custom code for releasing (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Feb 22, 2024
1 parent b90c4a4 commit ed4c87e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/python_cd.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,53 @@
name: Python CD

branding:
icon: "package"
color: "blue"

on:
release:
types: [ published ]

inputs:
BRANCH:
description: "Branch to publish from"
required: false
default: "main"
POETRY_VERSION:
description: "The version of Poetry to use"
required: false
default: "1.7.1"
POETRY_CORE_VERSION:
description: "The version of Poetry Core to use"
required: false
default: "1.8.1"
PUBLISH_REGISTRY:
description: "The registry to publish to"
required: false
default: "https://upload.pypi.org/legacy/"

jobs:
publish-pypi-package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Publish PyPi package
uses: code-specialist/pypi-poetry-publish@v1 # https://github.com/marketplace/actions/pypi-poetry-publish
- name: Checkout Repository
uses: actions/checkout@v3
with:
BRANCH: main
PYTHON_VERSION: "3.10"
POETRY_VERSION: 1.7.1
POETRY_CORE_VERSION: 1.8.1
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_TOKEN }}
ref: ${{ inputs.BRANCH }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify the tag version in the pyproject.toml
run: grep -q "version = \"${{ github.event.release.tag_name }}\"" pyproject.toml || exit 1
shell: bash
- name: Install poetry
run: pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
shell: bash
- name: Install dependencies
run: poetry install --no-root
shell: bash
- name: Build and Publish
run: |
poetry config repositories.publish ${{ inputs.PUBLISH_REGISTRY }}
poetry publish -p ${{ secrets.PYPI_TOKEN }} -u "__token__" -r publish --build
shell: bash
1 change: 0 additions & 1 deletion prediction_market_agent_tooling/__init__.py

This file was deleted.

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 = "prediction-market-agent-tooling"
version = "0.1.0"
version = "0.2.2"
description = "Tools to benchmark, deploy and monitor prediction market agents."
authors = ["Gnosis"]
readme = "README.md"
Expand Down

0 comments on commit ed4c87e

Please sign in to comment.