-
Notifications
You must be signed in to change notification settings - Fork 372
91 lines (77 loc) · 1.92 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Poetry
uses: snok/install-poetry@v1.3.4
with:
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up Python
id: python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: poetry
- name: Install dependencies
if: steps.python.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Build
run: poetry build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: package
path: dist/
retention-days: 7
if-no-files-found: error
pypi:
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi-publishing
url: https://pypi.org/project/hvac/
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: package
path: dist
- name: Show tree
run: tree
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
asset:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: package
path: dist
- name: Show tree
run: tree
- name: Add release asset
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
tag_name: ${{ github.event.release.tag_name }}
fail_on_unmatched_files: true
files: |
dist/*