Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CI release #5

Merged
merged 5 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
AurelienJaquier marked this conversation as resolved.
Show resolved Hide resolved
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
call-test-workflow:
uses: BlueBrain/BluePyEModel/.github/workflows/test.yml@main

build-and-publish:
name: Build, publish on PyPI and make a GitHub release
runs-on: ubuntu-latest
needs: call-test-workflow
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Fetch the tag, if any. If not tagged, create a patch tag
uses: anothrNick/github-tag-action@1.64.0
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch


- name: Build a source tarball and wheel
run: |
pip install wheel
python setup.py sdist bdist_wheel

- name: Get and store tag from 'Bump version and push tag' step
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ steps.tag.outputs.new_tag }}" >> $GITHUB_ENV
- name: Get and store tag from triggered tag push
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 0 additions & 4 deletions bluepyemodel/version.py

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
if sys.version_info < (3, 7):
sys.exit("Sorry, Python < 3.7 is not supported")

VERSION = imp.load_source("", "bluepyemodel/version.py").__version__

# Read the contents of the README file
with open("README.rst", encoding="utf-8") as f:
README = f.read()
Expand Down Expand Up @@ -57,7 +55,6 @@
setup_requires=['setuptools_scm'],
author="Blue Brain Project, EPFL",
author_email="",
version=VERSION,
description="Blue Brain Python E-Model Building Library",
long_description=README,
long_description_content_type="text/x-rst",
Expand Down