Skip to content

Commit

Permalink
Создание workflow для сборки релизов
Browse files Browse the repository at this point in the history
  • Loading branch information
YariKartoshe4ka committed Jan 27, 2022
1 parent 94ca33e commit fb6e673
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,67 @@
on:
push:
tags:
- '*'

name: Release

jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_name: ${{ steps.tag_name.outputs.tag }}
steps:
- name: Get tag name
id: tag_name
uses: olegtarasov/get-tag@v2.1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_API_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.tag_name.outputs.tag }}
body: |
# Draft release (${{ steps.tag_name.outputs.tag }})
### Changes
draft: true
prerelease: false

publish-pypi:
name: Publish on PyPI
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: pip install build
- name: Checkout code
uses: actions/checkout@v2
- name: Build project
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Get path to wheel
id: wheel_path
run: |
cd ./dist
echo '::set-output name=path::'$(ls -t *.whl | head -1)
- name: Upload wheel to GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_API_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./dist/${{ steps.wheel_path.outputs.path }}
asset_name: ${{ steps.wheel_path.outputs.path }}
asset_content_type: application/x-wheel+zip

0 comments on commit fb6e673

Please sign in to comment.