Repository navigation
69 lines (56 loc) · 1.77 KB
/
Copy pathdev-publish.yml
File metadata and controls
69 lines (56 loc) · 1.77 KB
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
# Manual workflow to build and publish dev Python packages from non-master branches.
name: Dev Publish
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
permissions:
contents: read
jobs:
guard:
name: Block master branch
runs-on: ubuntu-latest
steps:
- name: Fail if running on master
if: github.ref == 'refs/heads/master'
run: |
echo "::error::Dev publish is not allowed on the master branch."
exit 1
dev-build:
name: Build dev package
runs-on: ubuntu-latest
needs: guard
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- name: Install build dependencies
run: python -m pip install build
- name: Build package
run: python -m build
- name: Verify built distribution is importable
run: python scripts/verify_dist.py dist
- name: Upload build artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dev-dists
path: dist/
dev-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: dev-build
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/pyhive-integration
steps:
- name: Download build artifacts
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dev-dists
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
packages-dir: dist/