Commit e329030f authored by Georg Krause's avatar Georg Krause Committed by Agate
Browse files

Run build job only for master and tags

Now that the setup script handles the correct version number we can use
a single build job for stable and dev builds
parent 29490324
stages:
- test
- build
- publish
test:
stage: test
......@@ -12,3 +14,39 @@ test:
- pytest
tags:
- docker
build:
stage: build
image: python:3
before_script:
- apt-get update
- apt-get install libgirepository1.0-dev -y
- pip install .[build]
script:
- python3 setup.py sdist bdist_wheel
tags:
- docker
artifacts:
paths:
- dist/*
expire_in: 1 week
only:
- tags@funkwhale/mopidy
- master@funkwhale/mopidy
publish:
stage: publish
image: python:3
before_script:
- apt-get update
- apt-get install libgirepository1.0-dev -y
- pip install .[publish]
script:
- twine upload dist/*
tags:
- docker
dependencies:
- build
only:
- tags@funkwhale/mopidy
- master@funkwhale/mopidy
[metadata]
name = mopidy_funkwhale
description = "A backend extension for mopidy to stream music from a Funkwhale server"
version = 0.1.0
author = Eliot Berriot
author = The Funkwhale Collective
author_email = contact+funkwhale@eliotberriot.com
url = https://dev.funkwhale.audio/funkwhale/mopidy
long_description = file: README.rst
......@@ -40,6 +39,13 @@ dev =
ipython
ipdb
build =
setuptools
wheel
publish =
twine
[options.packages.find]
exclude =
tests
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
from setuptools import setup
setup()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version():
tag = os.getenv('CI_COMMIT_TAG', None)
if tag:
return tag
for line in read("mopidy_funkwhale/__init__.py").splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
version = line.split(delim)[1]
iid = os.getenv('CI_PIPELINE_IID', 0)
return "{}.dev{}".format(version, iid)
raise RuntimeError("Unable to find version string.")
setup(
version=get_version(),
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment