Skip to content

Commit 5303c12

Browse files
cd: pack pip package
Pack source code and wheel file with Github Actions. Result is stored as artifact. Part of #198
1 parent d8c8fcc commit 5303c12

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

Diff for: .github/workflows/packing.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: packing
2+
3+
on:
4+
push:
5+
pull_request:
6+
pull_request_target:
7+
types: [labeled]
8+
9+
jobs:
10+
pack_pip:
11+
# We want to run on external PRs, but not on our own internal
12+
# PRs as they'll be run by the push to the branch.
13+
#
14+
# The main trick is described here:
15+
# https://github.com/Dart-Code/Dart-Code/pull/2375
16+
if: (github.event_name == 'push') ||
17+
(github.event_name == 'pull_request' &&
18+
github.event.pull_request.head.repo.full_name != github.repository)
19+
runs-on: ubuntu-20.04
20+
21+
strategy:
22+
fail-fast: false
23+
24+
steps:
25+
- name: Clone the connector repo
26+
uses: actions/checkout@v2
27+
28+
- name: Setup Python and basic packing tools
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: '3.10'
32+
33+
- name: Install tools for packing
34+
run: pip install wheel
35+
36+
- name: Install tools for package verification
37+
run: pip install twine
38+
39+
- name: Pack source code
40+
run: python setup.py sdist
41+
42+
- name: Pack wheel file
43+
run: python setup.py bdist_wheel
44+
45+
- name: Verify the package
46+
run: twine check dist/*
47+
48+
- name: Archive pip artifacts
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: pip_dist
52+
path: dist
53+
retention-days: 1

0 commit comments

Comments
 (0)