feat(api): no auth for processing metrics (#2932) #25
This file contains 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: Auto Release on Version Change | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "pyproject.toml" | |
jobs: | |
check-and-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Extract version from pyproject.toml | |
id: get_version | |
run: | | |
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Check if release exists | |
id: check_release | |
run: | | |
TAG_EXISTS=$(git tag -l "v${{ steps.get_version.outputs.version }}") | |
if [ -z "$TAG_EXISTS" ]; then | |
echo "exists=false" >> $GITHUB_OUTPUT | |
else | |
echo "exists=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Release | |
if: steps.check_release.outputs.exists == 'false' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
name: Release v${{ steps.get_version.outputs.version }} | |
generate_release_notes: true | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |