ci test
Some checks failed
ci/woodpecker/push/style Pipeline was successful
ci/woodpecker/tag/style Pipeline failed
ci/woodpecker/tag/release Pipeline was successful

This commit is contained in:
June 2024-06-23 21:06:12 +02:00
parent d8b0e80487
commit 8295926cf9
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
2 changed files with 46 additions and 1 deletions

45
.woodpecker/release.yaml Normal file
View file

@ -0,0 +1,45 @@
# Links & Resources
# - https://hatch.pypa.io/latest/install/#pipx
# - https://woodpecker-ci.org/plugins/Release
# - https://forgejo.org/docs/latest/user/api-usage/
# - https://git.hamburg.ccc.de/api/swagger#/repository
when:
event: tag
# depends_on:
# - style
workspace:
base: /base
path: src
steps:
- name: build
image: debian
commands:
- apt-get update
- apt-get install -y pipx
- pipx install hatch
- /root/.local/bin/hatch build
- name: release
image: debian
commands:
- echo $SHELL
- apt-get update
- apt-get install -y git jq curl
# Directory for storing release information and request data.
- mkdir /base/release
# Get the release notes from the git tag.
- git tag -l --format='%(contents)' $CI_COMMIT_TAG > /base/release/release_notes
# Data for the release creation request.
- "echo '{\"body\": ' > /base/release/create_release_request_data.json"
- jq -Rs . /base/release/release_notes >> /base/release/create_release_request_data.json
- "echo ', \"name\": \"CI_COMMIT_TAG\", \"tag_name\": \"CI_COMMIT_TAG\"}' >> /base/release/create_release_request_data.json"
- "sed -i \"s/CI_COMMIT_TAG/$CI_COMMIT_TAG/g\" /base/release/create_release_request_data.json"
- cat /base/release/create_release_request_data.json
# Create the release.
- "curl -f --header \"Authorization: token $FORGEJO_RELEASE_ACCESS_TOKEN\" -X POST --json @/base/release/create_release_request_data.json \"$CI_FORGE_URL/api/v1/repos/$CI_REPO/releases\" > /base/release/create_release_response.json"
# Upload the release assets.
- "for FILE in /base/src/dist/*; do curl -f --header \"Authorization: token $FORGEJO_RELEASE_ACCESS_TOKEN\" -X POST -F \"attachment=@$FILE\" \"$CI_FORGE_URL/api/v1/repos/$CI_REPO/releases/$(jq -r .id /base/release/create_release_response.json)/assets\"; done"
secrets: [ FORGEJO_RELEASE_ACCESS_TOKEN ]

View file

@ -4,7 +4,7 @@
# - https://black.readthedocs.io/en/stable/usage_and_configuration/black_docker_image.html # - https://black.readthedocs.io/en/stable/usage_and_configuration/black_docker_image.html
when: when:
event: [push, pull_request] event: [push, pull_request, tag]
steps: steps:
- name: ruff - name: ruff