Skip to content

Commit 181f9be

Browse files
authored
Merge pull request #193 from jeremydvoss/publish
Added publish yml
2 parents 754bfeb + 9b62027 commit 181f9be

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-python@v1
13+
with:
14+
python-version: '3.7'
15+
- name: Build wheels
16+
run: ./scripts/build.sh
17+
- name: Install twine
18+
run: |
19+
pip install twine
20+
# The step below publishes to testpypi in order to catch any issues
21+
# with the package configuration that would cause a failure to upload
22+
# to pypi. One example of such a failure is if a classifier is
23+
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
24+
# middle of the package upload causing the action to fail, and certain packages
25+
# might have already been updated, this would be bad.
26+
- name: Publish to TestPyPI
27+
env:
28+
TWINE_USERNAME: '__token__'
29+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_AUTOMATIC_RELEASE_TOKEN }}
30+
run: |
31+
twine upload --repository testpypi --skip-existing --verbose dist/*
32+
- name: Publish to PyPI
33+
env:
34+
TWINE_USERNAME: '__token__'
35+
TWINE_PASSWORD: ${{ secrets.PYPI_AUTOMATIC_RELEASE_TOKEN }}
36+
run: |
37+
twine upload --skip-existing --verbose dist/*

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Added publishing action
6+
([#193](https://github.com/microsoft/ApplicationInsights-Python/pull/193))
7+
58
## [1.0.0b6](https://github.com/microsoft/ApplicationInsights-Python/releases/tag/v1.0.0b6) - 2022-08-30
69

710
- Drop support for Python 3.6

scripts/build.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
# This script builds wheels for the API, SDK, and extension packages in the
4+
# dist/ dir, to be uploaded to PyPI.
5+
6+
set -ev
7+
8+
# Get the latest versions of packaging tools
9+
python -m pip install --upgrade pip build setuptools wheel
10+
11+
BASEDIR=$(dirname $(readlink -f $(dirname $0)))
12+
DISTDIR=dist
13+
14+
(
15+
cd $BASEDIR
16+
mkdir -p $DISTDIR
17+
rm -rf $DISTDIR/*
18+
19+
for d in azure-monitor-opentelemetry-distro; do
20+
(
21+
echo "building $d"
22+
cd "$d"
23+
# Package distribution in dist folder
24+
python setup.py sdist --dist-dir "$BASEDIR/dist/" clean --all
25+
)
26+
done
27+
# Build a wheel for each source distribution
28+
(
29+
cd $DISTDIR
30+
for x in *.tar.gz ; do
31+
pip wheel --no-deps $x
32+
done
33+
)
34+
)

0 commit comments

Comments
 (0)