-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gh action to publish pyscitt to pypi
- Loading branch information
1 parent
fdd6ccb
commit 3a81577
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Publish pyscitt package to PyPi" | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build_and_publish: | ||
name: "Publish pyscitt package to PyPi" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get release number from git tag (release) or latest (branch) | ||
run: | | ||
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
id: tref | ||
|
||
- name: Fetch PyPi Package from release | ||
run: | | ||
cd pyscitt | ||
RELEASE_WHEEL_URL=$(curl -s https://api.github.com/repos/microsoft/scitt-ccf-ledger/releases/tags/${{steps.tref.outputs.version}} | jq -r '.assets[] | select(.name|test("pyscitt-.*.whl")) | .browser_download_url') | ||
echo ${RELEASE_WHEEL_URL} | ||
wget ${RELEASE_WHEEL_URL} | ||
- name: Publish PyPi Package to https://pypi.org/project/pyscitt/ | ||
run: | | ||
set -ex | ||
cd pyscitt | ||
python3 -m venv env | ||
source ./env/bin/activate | ||
pip install twine | ||
twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} *.whl |