Skip to content

Commit

Permalink
feat: time to give up on not repeating myself (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
msalib authored Dec 30, 2021
1 parent d8b4646 commit a8d915f
Showing 1 changed file with 3 additions and 44 deletions.
47 changes: 3 additions & 44 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CI

on:
push:
create:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -24,7 +26,6 @@ jobs:
# anyway so there's no point to run tests a third time.
BuildLinux:
runs-on: ubuntu-latest
if: "!(github.ref == 'refs/heads/main' && github.event_name == 'push')"
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -62,7 +63,6 @@ jobs:

BuildWindows:
runs-on: windows-latest
if: "!(github.ref == 'refs/heads/main' && github.event_name == 'push')"
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -92,7 +92,6 @@ jobs:

BuildMacOS:
runs-on: macos-latest
if: "!(github.ref == 'refs/heads/main' && github.event_name == 'push')"
steps:
- uses: actions/checkout@v2

Expand All @@ -113,43 +112,3 @@ jobs:
name: wheels
path: dist
retention-days: 2

# This only runs when we push to main. Instead of running tests, we
# bump the version and make a tag.
BumpVersion:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

# - run: git config user.name "GitHub actions"
# - run: git config user.email "[email protected]"
# - run: python3 -m pip install --user python-semantic-release
# - run: python -m semantic_release version -v DEBUG -D commit_author="github-actions <[email protected]>"

- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- run: git push

# We've got a new version! `Build` will run and after it finishes we
# can publish!
Publish:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ BuildLinux, BuildWindows, BuildMacOS ]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --repository-url=https://test.pypi.org/legacy/ --username=msalib --skip-existing *

0 comments on commit a8d915f

Please sign in to comment.