python-mylib/.woodpecker.yml

73 lines
2.9 KiB
YAML
Raw Normal View History

clone:
git:
image: woodpeckerci/plugin-git
tags: true
2022-04-27 17:14:38 +02:00
pipeline:
test:
image: brenard/debian-python-deb
commands:
- DEBIAN_FRONTEND=noninteractive apt-get -qq update < /dev/null > /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -y -qq upgrade < /dev/null > /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -qq -y install --no-install-recommends pkg-config libsystemd-dev libldap2-dev libsasl2-dev libpq-dev libmariadb-dev wget unzip < /dev/null > /dev/null
- wget --no-verbose -O /opt/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip
- unzip -qq -d /opt /opt/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip
- echo /opt/instantclient_* > /etc/ld.so.conf.d/oracle-instantclient.conf
- ldconfig
- ./tests.sh --quiet
2022-04-28 00:36:11 +02:00
build:
image: brenard/debian-python-deb
2022-04-27 20:20:52 +02:00
when:
event: tag
commands:
- echo "$GPG_KEY"|base64 -d|gpg --import
- ./build.sh --quiet
- rm -fr deb_dist/mylib-*
secrets: [ maintainer_name, maintainer_email, gpg_key, debian_codename ]
2022-04-28 00:36:11 +02:00
publish-dryrun:
group: publish
image: alpine
2022-04-28 00:36:11 +02:00
when:
event: tag
2022-04-28 00:36:11 +02:00
commands:
- ls dist/*
2022-05-01 00:01:38 +02:00
- ls deb_dist/*
2022-04-28 00:36:11 +02:00
publish-gitea:
group: publish
image: plugins/gitea-release
2022-04-27 20:20:52 +02:00
when:
event: tag
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.zionetrix.net
2022-04-27 22:57:38 +02:00
files:
- dist/*
2022-05-01 00:01:38 +02:00
- deb_dist/*.deb
checksum:
- md5
- sha512
publish-apt:
group: publish
image: brenard/curl
when:
event: tag
commands:
2022-05-01 00:01:38 +02:00
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/python3-mylib_*_all.deb ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/mylib_*.dsc ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/mylib_*.orig.tar.gz ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/mylib_*.debian.tar.xz ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/mylib_*.buildinfo ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST -F file=@$( ls deb_dist/mylib_*.changes ) $APT_API_URL/files/python3-mylib
- curl -u $APT_CREDS -X POST $APT_API_URL/repos/$APT_REPO_NAME/include/python3-mylib
- APT_SNAP_NAME=$(date +%s)_$APT_REPO_NAME
- >
curl -u $APT_CREDS -X POST -H 'Content-Type: application/json' --data "{\"Name\":\"$APT_SNAP_NAME\"}" $APT_API_URL/repos/$APT_REPO_NAME/snapshots
- >
curl -u $APT_CREDS -X PUT -H 'Content-Type: application/json' --data "{\"Snapshots\": [{\"Component\": \"main\", \"Name\": \"$APT_SNAP_NAME\"}]}" $APT_API_URL/publish/:./$APT_REPO_NAME
secrets: [ apt_api_url, apt_creds, apt_repo_name ]