Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 83d00208 authored by Philippe Virouleau's avatar Philippe Virouleau
Browse files

Version 1.1.1

Create the CI for an automatic push to PyPi.
parent 8b61ae12
Branches release
Tags 1.1.1
No related merge requests found
stages:
- build
- test
# - deploy
- publish
create-venv:
stage: build
......@@ -60,3 +60,13 @@ test_coverage:
artifacts:
paths:
- test_results/coverage_html/
publish-pypi:
stage: publish
rules:
- if: $CI_COMMIT_TAG
image: python:3.8
tags:
- grid5000-docker
script:
- make release
......@@ -95,16 +95,17 @@ integration: clean_cache venv check_format lint installable test_coverage
# clean_cache will make sure we download the last versions of linters.
# Use `make -k integration` to run all checks even if previous fails.
release: integration
release: clean_cache venv installable
echo "Releasing submitit_oar $(CURRENT_VERSION)"
[ ! -d dist ] || rm -r dist
# Make sure the repo is in a clean state
git diff --exit-code
# Make sure we're creating a release for a tag which matches the version.
[ "`git describe --tag --exact-match $(git rev-parse HEAD)`" = "$(CURRENT_VERSION)" ] && echo "Found a tag matching current version"
# FLIT_PASSWORD is set by gitlab's variable environments.
[ -n "$(FLIT_PASSWORD)" ] || (echo "FLIT_PASSWORD not set, fix gitlab's variables, or provide it" && exit 1)
# --setup-py generates a setup.py file to allow user with old
# versions of pip to install it without flit.
git tag $(CURRENT_VERSION)
# To have a reproducible build we use the timestamp of the last commit:
# https://flit.pypa.io/en/latest/reproducible.html
SOURCE_DATE_EPOCH=`git log -n1 --format=%cd --date=unix` $(BIN)python -m flit publish --setup-py
git checkout HEAD -- README.md
git push origin $(CURRENT_VERSION)
FLIT_USERNAME="__token__" SOURCE_DATE_EPOCH=`git log -n1 --format=%cd --date=unix` $(BIN)python -m flit publish --setup-py
......@@ -32,3 +32,8 @@ assert output == 12
```
You can try running this above example with a breakpoint at https://github.com/facebookincubator/submitit/blob/main/submitit/core/plugins.py#L33, to be sure that Submitit correctly finds the submitit_oar plugin.
# Releasing submitit_oar
Create a tag matching the version to release in gitlab, it should create a pipeline which will push the package to PyPi.
If you want to do this manually, populate the `FLIT_PASSWORD` environment variable with the API token, and run `make release`
......@@ -3,4 +3,4 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__version__ = "1.1.0"
__version__ = "1.1.1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment