forked from camas/setuptools-git-ver
-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Showing
2 changed files
with
45 additions
and
27 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 |
---|---|---|
|
@@ -7,24 +7,32 @@ on: | |
|
||
jobs: | ||
|
||
prod: | ||
name: Release version | ||
wait: | ||
name: Wait for tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Wait for tests | ||
uses: fountainhead/[email protected] | ||
- uses: fountainhead/[email protected] | ||
id: wait-for-tests | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
checkName: Run tests | ||
checkName: Tests done | ||
ref: ${{ github.ref }} | ||
timeoutSeconds: 3600 | ||
|
||
- name: Fail the Build | ||
uses: cutenode/action-always-fail@v1 | ||
if: steps.wait-for-tests.outputs.conclusion != 'success' | ||
|
||
build: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
needs: [wait] | ||
strategy: | ||
matrix: | ||
python-version: ['2.7', '3.6'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -33,6 +41,8 @@ jobs: | |
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
|
@@ -48,15 +58,28 @@ jobs: | |
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip setuptools wheel twine | ||
|
||
- name: Download artifacts | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow: test.yml | ||
workflow_conclusion: success | ||
name: dist | ||
path: ./dist/ | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Build package | ||
run: python setup.py bdist_wheel sdist | ||
|
||
- name: Check package | ||
run: twine check dist/* | ||
|
||
- name: Publish package | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
twine upload --skip-existing dist/* | ||
release: | ||
name: Release version | ||
runs-on: ubuntu-latest | ||
needs: [wait, build] | ||
|
||
steps: | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
|
@@ -66,12 +89,4 @@ jobs: | |
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
TWINE_REPOSITORY_URL: dolfinus/setuptools-git-versioning | ||
run: | | ||
twine upload dist/* | ||
prerelease: false |
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