6
6
jobs :
7
7
8
8
release :
9
+ permissions :
10
+ contents : write
11
+
9
12
name : Release
10
13
runs-on : ubuntu-latest
11
14
steps :
12
15
- uses : actions/checkout@v3
13
- - name : Set Version
14
- run : echo "VERSION=$(awk -F' = ' '/^\[tool.poetry\]$/{f=1} f&&/^version = /{gsub(/"/, "", $2); print $2; exit}' pyproject.toml)" >> $GITHUB_ENV
15
16
16
- - name : Create tag
17
- uses : actions/github-script@v5
18
- with :
19
- script : |
20
- github.rest.git.createRef({
21
- owner: context.repo.owner,
22
- repo: context.repo.repo,
23
- ref: 'refs/tags/V${{ env.VERSION }}',
24
- sha: context.sha
25
- })
26
- - name : Create a Release
27
- uses : elgohr/Github-Release-Action@v4
28
- env :
29
- GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
17
+ - name : Install Poetry
18
+ uses : snok/install-poetry@v1
30
19
with :
31
- title : Release ${{ env.VERSION }}
20
+ version : 1.3.2
21
+
22
+ - name : Set Version
23
+ run : echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
24
+
25
+ # - name: Create tag
26
+ # uses: actions/github-script@v5
27
+ # with:
28
+ # script: |
29
+ # github.rest.git.createRef({
30
+ # owner: context.repo.owner,
31
+ # repo: context.repo.repo,
32
+ # ref: 'refs/tags/V${{ env.VERSION }}',
33
+ # sha: context.sha
34
+ # })
32
35
33
- - name : Check python versions
34
- run : |
35
- python --version
36
- python3 --version
37
- which python3.10
38
- python3.10 --version
39
36
- name : Build and publish to pypi
40
37
run : |
41
- curl -sSL https://install.python-poetry.org | python3.10 -
42
- poetry publish -u pinecone -p ${{ secrets.PYPI_PASSWORD }} --build
38
+ poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
39
+ poetry publish --build
40
+
41
+ - name : Create GH release
42
+ uses : ncipollo/release-action@v1
43
+ env :
44
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
+ with :
46
+ tag : ${{ env.VERSION }}
47
+ name : ${{ env.VERSION }}
48
+ artifacts : " dist/*"
0 commit comments