SCECcode / pycsep

Tools to help earthquake forecast model developers build and evaluate their forecasts
https://docs.cseptesting.org
BSD 3-Clause "New" or "Revised" License
49 stars 23 forks source link

ci action to publish release on tag #152

Closed wsavran closed 2 years ago

wsavran commented 2 years ago

we should implement a pipeline to help pushing out releases of pyCSEP based on the github action.

on:
    release:
         types: [created]

tags'. this triggers when a tag is pushed to the repo. the action should do the following:

  1. build
  2. create binaries using ``python setup.py sdist
  3. upload to pypi using twine
    twine upload dist/*

assuming the HEAD commit contains all the code changes for the release process would be as follows:

  1. create a release commit that bumps the version numbers in the package
    • _version.py
    • setup.py
    • docs/
    • codemeta.json
  2. update CHANGELOG.md
  3. update CREDITS.md (if necessary)
  4. issue pull request with these changes
  5. merge changes
  6. create release on GitHub using name "vX.Y.z" to signifies the version

this process should create a tag along with the release on GitHub. this would trigger the CI to push this release to pypi. we want to be publishing releases relatively rapidly, so any extra steps to automate this process would be great.

wsavran commented 2 years ago
name: Publish pyCSEP

on:
  release:
    types: [created]

jobs:
  deploy:
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine
    - name: Build and publish
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*
wsavran commented 2 years ago

added with v0.6.0