-
Notifications
You must be signed in to change notification settings - Fork 13
48 lines (39 loc) · 1.03 KB
/
cd.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
name: CD
on:
workflow_dispatch:
jobs:
release:
permissions:
contents: write
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
- name: Set Version
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
# - name: Create tag
# uses: actions/github-script@v5
# with:
# script: |
# github.rest.git.createRef({
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: 'refs/tags/V${{ env.VERSION }}',
# sha: context.sha
# })
- name: Build and publish to pypi
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build
- name: Create GH release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.VERSION }}
name: ${{ env.VERSION }}
artifacts: "dist/*"