This repository has been archived by the owner on Nov 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c364ef
commit b2bede6
Showing
2 changed files
with
87 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,51 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
|
||
name: Upload Python Package to TestPyPi | ||
|
||
on: | ||
# Triggers the workflow when a release is created | ||
release: | ||
types: [published] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python Package to TestPyPi | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: get latest release with tag | ||
id: latestrelease | ||
run: | | ||
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/dylanljones/cmpy/releases/latest --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq '.tag_name' | sed 's/\"//g')" | ||
- name: confirm release tag | ||
run: | | ||
echo ${{ steps.latestrelease.outputs.releasetag }} | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ steps.latestrelease.outputs.releasetag }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine | ||
pip install .[build] | ||
- name: Build and publish distribution 📦 to Test PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload --repository testpypi dist/* |
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,36 @@ | ||
name: Test Installation | ||
|
||
on: | ||
push: | ||
branches: [master, dev] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build and install | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ["3.10"] | ||
other-os: [false] | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.other-os }} # don't cancel due to OS specific failures | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build and install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Get package version | ||
run: python setup.py --version |