50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python: [3.6]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Install tox
|
|
run: pip install tox
|
|
- name: Build wheel
|
|
id: build_wheel
|
|
run: |
|
|
tox -e release
|
|
echo ::set-output name=wheel_name::chweb-$(python setup.py --version)-py3-none-any.whl
|
|
- name: Create release
|
|
uses: actions/create-release@v1
|
|
id: release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Check wheel name
|
|
run: echo ${{ steps.build_wheel.outputs.wheel_name }}
|
|
- name: Upload Release Asset
|
|
id: upload-release-asset
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.release.outputs.upload_url }}
|
|
asset_path: ./dist/${{ steps.build_wheel.outputs.wheel_name }}
|
|
asset_name: ${{ steps.build_wheel.outputs.wheel_name }}
|
|
asset_content_type: application/zip
|