Skip to content

Commit

Permalink
CI: Start building gl-client-py and greenlight-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nitramiz authored and nepet committed Sep 3, 2024
1 parent 587dc4a commit a35afc2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
variables:
GIT_DEPTH: 1
CI_IMAGE: blockstream/gli-ci

stages:
Expand Down
39 changes: 39 additions & 0 deletions gitlab/build-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
build_gl_client_py:
extends: .build_setup
when: manual
rules:
- if: $CI_COMMIT_TAG =~ /glclientpy_\d{8}(_[1-9][0-9]?)?\-.*/
before_script:
- export NEW_VER=$(echo ${CI_COMMIT_TAG} | cut -d'-' -f2)
- sed -i "s/^version = \".*\"/version = \"$NEW_VER\"/" libs/gl-client-py/pyproject.toml
- sed -i "s/^version = \".*\"/version = \"$NEW_VER\"/" libs/gl-client-py/Cargo.toml
- . $HOME/.cargo/env # sh doesn't have the correct PATH
script:
- poetry run maturin build -m libs/gl-client-py/Cargo.toml --release || sleep 3600
- poetry run maturin sdist -m libs/gl-client-py/Cargo.toml
- poetry run maturin upload --username __token__ --password ${PYPI_TOKEN} target/wheels/*
- ls -lh target/wheels
artifacts:
expire_in: 2 weeks
paths:
- "target/wheels/*"

build_glcli:
extends: .build_setup
when: manual
rules:
- if: $CI_COMMIT_TAG =~ /glcli_\d{8}(_[1-9][0-9]?)?\-.*/
before_script:
- export NEW_VER=$(echo ${CI_COMMIT_TAG} | cut -d'-' -f2)
- sed -i "s/^version = \".*\"/version = \"$NEW_VER\"/" tools/glcli/pyproject.toml
- . $HOME/.cargo/env # sh doesn't have the correct PATH
script:
- cd tools/glcli
- poetry config pypi-token.pypi ${PYPI_TOKEN}
- poetry build
- poetry publish
- ls -lh dist
artifacts:
expire_in: 2 weeks
paths:
- "tools/glcli/dist/*"
3 changes: 2 additions & 1 deletion gitlab/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ build_ci_image:
script:
- docker pull ${CI_IMAGE}:latest || true
- export IMAGE_TAG=${CI_COMMIT_SHORT_SHA}-$(date +%Y%m%d)
- cd docker
- >
docker build
-f docker/ci.Dockerfile
-f ci.Dockerfile
--network=host
--build-arg BUILDKIT_INLINE_CACHE=1
--cache-from ${CI_IMAGE}:latest
Expand Down

0 comments on commit a35afc2

Please sign in to comment.