Files
hello_gitea/.gitea/workflows/build.yaml
direct-dev.ru 5614bd6ada
Some checks failed
Release Build / release (push) Failing after 44s
Исправлен workflow - 5 для сборки и релиза
2025-07-27 13:18:21 +06:00

50 lines
1.7 KiB
YAML

name: Release Build
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: 'GiteaAdmin/hello_gitea'
path: 'hello_gitea'
token: ${{ secrets.GITEATOKEN }}
ref: ${{ github.ref }}
- name: Build
run: |
cd hello_gitea
mkdir -p bin
go build -o bin/hello-api-${{ github.ref_name }} main.go
ls -la bin/
- name: Create Release
run: |
cd hello_gitea
# Create release using Gitea API
curl -X POST \
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ github.ref_name }}",
"name": "Release ${{ github.ref_name }}",
"body": "Automated release",
"draft": false,
"prerelease": false
}' \
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases"
# Upload asset
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITEATOKEN }}" \
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/tags/${{ github.ref_name }}" | \
jq -r '.id')
curl -X POST \
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @bin/hello-api-${{ github.ref_name }} \
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/$RELEASE_ID/assets?name=hello-api-${{ github.ref_name }}"