feat: Add enable_assets_returned_as_base64 to ParserConfig (#131) #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release on pyproject.toml Update | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "pyproject.toml" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Extract version from pyproject.toml | |
id: extract_version | |
run: | | |
VERSION=$(grep '^version =' pyproject.toml | awk -F' = ' '{print $2}' | tr -d '"') | |
echo "::set-output name=version::$VERSION" | |
- name: Check if tag exists | |
id: check_tag | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const tagName = 'v${{ steps.extract_version.outputs.version }}'; | |
const { data: tags } = await github.git.listMatchingRefs({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `tags/${tagName}` | |
}); | |
if (tags.length > 0) { | |
console.log(`Tag ${tagName} already exists. Skipping release creation.`); | |
core.setOutput('tag_exists', 'true'); | |
} else { | |
console.log(`Tag ${tagName} does not exist. Proceeding with release creation.`); | |
core.setOutput('tag_exists', 'false'); | |
} | |
- name: Create Release | |
if: steps.check_tag.outputs.tag_exists == 'false' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.extract_version.outputs.version }} | |
release_name: Release v${{ steps.extract_version.outputs.version }} | |
draft: false | |
prerelease: false | |
publish: | |
needs: [ release ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Bootstrap poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 | |
- name: Install dependencies | |
run: poetry install | |
- name: Publish to pypi | |
run: | | |
poetry config repositories.remote https://upload.pypi.org/legacy/ | |
poetry --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_TOKEN" | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |