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 buildsmain
parent
294903245d
commit
e329030ff1
|
@ -1,5 +1,7 @@
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
- build
|
||||||
|
- publish
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
@ -12,3 +14,39 @@ test:
|
||||||
- pytest
|
- pytest
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- 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
|
||||||
|
|
10
setup.cfg
10
setup.cfg
|
@ -1,8 +1,7 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = mopidy_funkwhale
|
name = mopidy_funkwhale
|
||||||
description = "A backend extension for mopidy to stream music from a Funkwhale server"
|
description = "A backend extension for mopidy to stream music from a Funkwhale server"
|
||||||
version = 0.1.0
|
author = The Funkwhale Collective
|
||||||
author = Eliot Berriot
|
|
||||||
author_email = contact+funkwhale@eliotberriot.com
|
author_email = contact+funkwhale@eliotberriot.com
|
||||||
url = https://dev.funkwhale.audio/funkwhale/mopidy
|
url = https://dev.funkwhale.audio/funkwhale/mopidy
|
||||||
long_description = file: README.rst
|
long_description = file: README.rst
|
||||||
|
@ -40,6 +39,13 @@ dev =
|
||||||
ipython
|
ipython
|
||||||
ipdb
|
ipdb
|
||||||
|
|
||||||
|
build =
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
|
||||||
|
publish =
|
||||||
|
twine
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
exclude =
|
exclude =
|
||||||
tests
|
tests
|
||||||
|
|
24
setup.py
24
setup.py
|
@ -1,5 +1,27 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import codecs
|
||||||
|
import os
|
||||||
from setuptools import setup
|
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(),
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue