From 8f868529f855c6e55ac11f5a2f983d923dd8f6df Mon Sep 17 00:00:00 2001 From: erris Date: Tue, 10 Mar 2026 22:14:22 +0100 Subject: [PATCH] Edit .onedev-buildspec.yml --- .onedev-buildspec.yml | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index e01b088..a8b62ec 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -80,6 +80,53 @@ jobs: condition: SUCCESSFUL optional: false jobExecutor: luna-executor + triggers: + - type: BranchUpdateTrigger + branches: main + userMatch: anyone + projects: OpenEngine + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 +- name: Release to Gitea + steps: + - type: CommandStep + name: Release to Gitea + runInContainer: true + image: erriss/erris-build-tools:V0.7 + interpreter: + type: DefaultInterpreter + commands: | + # 1. Create the Release metadata + RELEASE_JSON=$(printf '{"tag_name":"v1.0.%s","target_commitish":"main","name":"Release v1.0.%s","body":"Automated build from OneDev","draft":false,"prerelease":false}' "$ONEDEV_BUILD_NUMBER" "$ONEDEV_BUILD_NUMBER") + + curl -X 'POST' \ + "https://gitea.anfer.fr/api/v1/repos/owner/repo/releases" \ + -H "Authorization: token @secret:Gitea@" \ + -H "Content-Type: application/json" \ + -d "$RELEASE_JSON" > release_info.json + + # 2. Extract the Release ID (using jq) + RELEASE_ID=$(jq '.id' release_info.json) + + # 3. Upload your binary (oe_editor) + curl -X 'POST' \ + "https://gitea.anfer.fr/api/v1/repos/owner/repo/releases/$RELEASE_ID/assets?name=oe_editor" \ + -H "Authorization: token @secret:Gitea@" \ + -H "Content-Type: application/octet-stream" \ + --data-binary editor/oe_editor + envVars: + - name: ONEDEV_BUILD_NUMBER + value: '1' + useTTY: true + condition: SUCCESSFUL + optional: false + jobExecutor: terra-executor + jobDependencies: + - jobName: Compile for Linux + requireSuccessful: true + artifacts: '**' retryCondition: never maxRetries: 3 retryDelay: 30