-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·60 lines (59 loc) · 2.04 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -O
python install-poetry.py --preview --version 1.2.0a1
- name: Add path for Poetry
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Add Poetry Plugin
# poetry plugin add poetry-version-plugin
run: |
pip install poetry-version-plugin
- name: PyPI Settings
run: |
poetry config pypi-token.pypi ${{secrets.PYPI_TOKEN}}
- name: Build Poetry
run: |
git tag v${{ github.event.inputs.version }}
poetry build
poetry publish
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: Release v${{ github.event.inputs.version }}
body: |
${{ github.event.inputs.release_note }}
draft: false
prerelease: false
- name: Get Name of Artifact
run: |
ARTIFACT_PATHNAME=$(ls dist/*.whl | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
- name: Upload Whl to Release Assets
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/x-wheel+zip