migrate content #1

Merged
OCram85 merged 24 commits from migrate/content into main 2024-05-14 07:40:39 +02:00
8 changed files with 263 additions and 2 deletions

38
.changelog.yml Normal file
View File

@ -0,0 +1,38 @@
# The full repository name
repo: plugins/gitea-package
# Service type (gitea or github)
service: gitea
# Base URL for Gitea instance if using gitea service type (optional)
# Default: https://gitea.com
base-url: https://gitea.ocram85.com
# Changelog groups and which labeled PRs to add to each group
groups:
- name: 🐛 BUGFIXES
labels:
- bug
- name: ✨ FEATURES
labels:
- feature
- name: 🛠️ ENHANCEMENTS
labels:
- enhancement
- name: 📦 BUILD
labels:
- pipeline
- name: 🤖 DEPENDENCIES
labels:
- renovate
- name: 📚 DOCS
labels:
- docs
- name: ⚙️ META
labels:
- meta
- name: 🔖 MISC
default: true
# regex indicating which labels to skip for the changelog
skip-labels: skip-changelog|backport\/.+

37
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Update GiteaChangelog",
"type": "shell",
"command": [
"mv 'CHANGELOG.md' 'CHANGELOG.back' &&",
"changelog -m '${input:Milestone}' --token '${input:GiteaToken}' -c .changelog.yml generate > CHANGELOG.md &&",
"echo '' >> CHANGELOG.md &&",
"cat CHANGELOG.back >> CHANGELOG.md &&",
"rm CHANGELOG.back"
],
"problemMatcher": []
}
],
"inputs": [
{
"id": "GiteaToken",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "echo $GITEA_TOKEN",
"description": "Your personal Gitea access token"
}
},
{
"id": "Milestone",
"type": "command",
"command": "shellCommand.execute",
"args": {
"description": "Select or enter a open milestone",
"command": "tea milestone ls -f title --output simple"
}
}
]
}

82
.woodpecker/ci.yml Normal file
View File

@ -0,0 +1,82 @@
when:
- event: [pull_request, tag, cron]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
variables:
- &build_plugin 'woodpeckerci/plugin-docker-buildx:3.2.1'
# deployment targets
- &publish_repos 'ocram85/plugin-gitea-package,gitea.ocram85.com/plugins/gitea-package'
# logins for deployment targets
- publish_logins: &publish_logins
# Default DockerHub login
- registry: https://index.docker.io/v1/
username:
from_secret: docker_user
password:
from_secret: docker_passwd
# Additional Quay.IO login
- registry: https://gitea.ocram85.com
username:
from_secret: gitea_user
password:
from_secret: gitea_passwd
steps:
test:
image: *build_plugin
settings:
dry_run: true
registry: gitea.ocram85.com
repo: test
dockerfile: Dockerfile
platforms: linux/amd64
auto_tag: true
build_args:
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
- TAG=${CI_COMMIT_TAG}
when:
event: pull_request
branch: ${CI_REPO_DEFAULT_BRANCH}
publish:
image: *build_plugin
settings:
repo: *publish_repos
dockerfile: Dockerfile
platforms: linux/amd64
auto_tag: true
logins: *publish_logins
build_args:
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
- TAG=${CI_COMMIT_TAG}
when:
event: [push, tag, cron]
branch: ${CI_REPO_DEFAULT_BRANCH}
build-next:
image: *build_plugin
settings:
repo: *publish_repos
dockerfile: Dockerfile
platforms: linux/amd64
tag: next
logins: *publish_logins
build_args:
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
- TAG=${CI_COMMIT_TAG}
when:
event: [pull_request]
gitea-release:
image: plugins/gitea-release
settings:
api_key:
from_secret: RENOVATE_TOKEN
base_url: https://gitea.ocram85.com
title: ${CI_COMMIT_TAG}
note: "> :bulb: **Note:** See [CHANGELOG.md](src/branch/master/CHANGELOG.md) for recent changes."
when:
event: [tag]
branch: ${CI_REPO_DEFAULT_BRANCH}

View File

@ -0,0 +1,23 @@
when:
- event: [pull_request, tag, cron]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
depends_on:
- "ci"
steps:
test-next:
image: gitea.ocram85.com/plugins/gitea-package:next
pull: true
settings:
debug: "true"
owner: "testuser"
package_name: "dummy_package"
package_version: "0.1.0"
file_name: "./README.md"
update: "true"
when:
event: pull_request
branch: ${CI_REPO_DEFAULT_BRANCH}

0
CHANGELOG.md Normal file
View File

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM curlimages/curl:8.7.1
LABEL org.opencontainers.image.authors="marco@ocram85.com"
#ENV PLUGIN_OWNER
#ENV PLUGIN_PACKAGE_NAME
#ENV PLUGIN_PACKAGE_VERSION
#ENV PLUGIN_FILE_NAME
#ENV PLUGIN_UPDATE
#ENV PLUGIN_DEBUG="1"
USER root
COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh
#RUN [ "chmod", "+x", "/app/gitea-package.sh" ]
USER curl_user
ENTRYPOINT [ "/app/gitea-package.sh" ]

View File

@ -17,12 +17,12 @@
</h1>
<p align="center">
Pluging to Publish Artifatcs to Gitea Generic Package Registry
Plugin to Publish Artifacts to Gitea Generic Package Registry
</p>
<p align="center">
<a href="https://drone.ocram85.com/plugins/gitea-package">
<img src="https://drone.ocram85.com/api/badges/plugins/gitea-package/status.svg" alt="Master Branch Build Status">
<img src="https://drone.ocram85.com/api/badges/plugins/gitea-package/status.svg" alt="Main Branch Build Status">
</a>
</p>

65
gitea-package.sh Executable file
View File

@ -0,0 +1,65 @@
#!/usr/bin/env sh
set -e
say() {
if [ -n "$2" ]; then
printf "🤖 \e[32mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1"
else
printf "🤖 \e[32mgitea-package\e[0m: %s \n" "$1"
fi
}
sayE() {
if [ -n "$2" ]; then
printf "🤖 \e[31mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
else
printf "🤖 \e[31mgitea-package\e[0m: %s \n" "$1" 1>&2
fi
}
sayW() {
if [ -n "$2" ]; then
printf "🤖 \e[33mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
else
printf "🤖 \e[33mgitea-package\e[0m: %s \n" "$1" 1>&2
fi
}
showHelp() {
cat << HELP
🤖 gitea-package Woodpecker-CI Plugin
Syntax:
HELP
}
showENV() {
env | sort
}
showSettings() {
say "PLUGIN_OWNER: $PLUGIN_OWNER" "showSettings"
say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" "showSettings"
say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" "showSettings"
say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" "showSettings"
say "PLUGIN_UPDATE: $PLUGIN_UPDATE" "showSettings"
}
uploadArtifact() {
curl --user your_username:your_password_or_token \
--upload-file path/to/file.bin \
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin
}
main() {
if [ -n "$PLUGIN_DEBUG" ]; then
sayW "Debug mode enabled."
showSettings
sayW "Available ENV vars:"
showENV
exit 0
fi
}
main "$@"