Edit .onedev-buildspec.yml
This commit is contained in:
@@ -80,6 +80,53 @@ jobs:
|
|||||||
condition: SUCCESSFUL
|
condition: SUCCESSFUL
|
||||||
optional: false
|
optional: false
|
||||||
jobExecutor: luna-executor
|
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
|
retryCondition: never
|
||||||
maxRetries: 3
|
maxRetries: 3
|
||||||
retryDelay: 30
|
retryDelay: 30
|
||||||
|
|||||||
Reference in New Issue
Block a user