Skip to content

Поменял версию #10

Поменял версию

Поменял версию #10

Workflow file for this run

name: Check and Create Release
on:
push:
branches:
- main
jobs:
check_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Get current version
id: get_version
run: |
echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
- name: Check if version is pre-release
id: check_prerelease
run: |
if [[ "${{ env.VERSION }}" == *"alpha"* || "${{ env.VERSION }}" == *"beta"* ]]; then
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
else
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
fi
- name: Get latest release version
id: get_latest_release
run: |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "LATEST_RELEASE=${LATEST_RELEASE}" >> $GITHUB_ENV
- name: Compare versions
id: compare_versions
run: |
if [ "${{ env.VERSION }}" != "${{ env.LATEST_RELEASE }}" ]; then
echo "NEW_VERSION=true" >> $GITHUB_ENV
else
echo "NEW_VERSION=false" >> $GITHUB_ENV
fi
- name: Build package
if: env.NEW_VERSION == 'true' && env.IS_PRERELEASE == 'false'
run: |
poetry build
- name: Create new release
if: env.NEW_VERSION == 'true' && env.IS_PRERELEASE == 'false'
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: |
New release ${{ env.VERSION }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Upload release asset
if: env.NEW_VERSION == 'true' && env.IS_PRERELEASE == 'false'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/manimextra-${{ env.VERSION }}.tar.gz
asset_name: manimextra-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}