kind: pipeline type: docker name: default steps: - name: test image: git.snas.black-burn.ch/sean/poetry-in-a-container:3.11 volumes: - name: poetry_cache path: /root/.cache/pypoetry/virtualenvs - name: pip_cache path: /root/.cache/pip/ - name: poetry_bin path: /root/.local/bin - name: pre_commit_environments path: /root/.cache/pre-commit commands: - poetry install - poetry run pre-commit run -a - name: build-latest image: plugins/docker settings: username: from_secret: NUCNAS_GITEA_DOCKER_USERNAME password: from_secret: NUCNAS_GITEA_DOCKER_PASSWORD repo: git.snas.black-burn.ch/${DRONE_REPO_NAMESPACE,,}/${DRONE_REPO_NAME,,} registry: git.snas.black-burn.ch volumes: - name: docker_sock path: /var/run/docker.sock when: ref: exclude: - refs/tags/* branch: exclude: - renovate/* - name: pypi_publish image: python:3.12 volumes: - name: poetry_cache path: /root/.cache/pypoetry/virtualenvs - name: pip_cache path: /root/.cache/pip/ environment: USERNAME: from_secret: GITEA_REPO_USERNAME PASSWORD: from_secret: GITEA_REPO_PASSWORD commands: - pip install poetry - poetry config repositories.gitea https://git.snas.black-burn.ch/api/packages/${DRONE_REPO_NAMESPACE,,}/pypi - poetry publish --build --repository gitea --username $USERNAME --password $PASSWORD when: ref: - refs/tags/* branch: exclude: - renovate/* - name: build-release image: plugins/docker settings: username: from_secret: NUCNAS_GITEA_DOCKER_USERNAME password: from_secret: NUCNAS_GITEA_DOCKER_PASSWORD repo: git.snas.black-burn.ch/${DRONE_REPO_NAMESPACE,,}/${DRONE_REPO_NAME,,} registry: git.snas.black-burn.ch auto_tag: true volumes: - name: docker_sock path: /var/run/docker.sock when: ref: - refs/tags/* branch: exclude: - renovate/* - name: semantic-release image: git.snas.black-burn.ch/sean/semantic-release-in-a-container:1 environment: GITEA_URL: from_secret: GITEA_URL GITEA_TOKEN: from_secret: GITEA_SEMANTIC_RELEASE_TOKEN commands: - semantic-release when: branch: - "*.*.x" - main - master - next - next-major - beta - alpha - name: discord notification image: appleboy/drone-discord when: status: - failure - success settings: username: drone-ci webhook_id: from_secret: DISCORD_WEBHOOK_ID webhook_token: from_secret: DISCORD_WEBHOOK_TOKEN message: > {{#success build.status}} :green_square: {{repo.name}} #{{build.number}} {{commit.branch}} / {{truncate commit.sha 8}} / {{commit.author}} Build succeeded! {{else}} :red_square: {{repo.name}} #{{build.number}} {{commit.branch}} / {{truncate commit.sha 8}} / {{commit.author}} Build failed! {{/success}} volumes: - name: docker_sock host: path: /var/run/docker.sock - name: poetry_cache host: path: /tmp-drone/cache/poetry - name: pip_cache host: path: /tmp-drone/cache/pip - name: poetry_bin host: path: /tmp-drone/cache/poetry_bin - name: pre_commit_environments host: path: /tmp-drone/cache/pre_commit_environments