#3: Create a release in Gitea #5

Merged
devastator merged 7 commits from feature/3-release into master 2026-09-28 15:35:29 +03:00
2 changed files with 25 additions and 3 deletions
Showing only changes of commit 4cb112faf1 - Show all commits
+18
View File
@@ -25,3 +25,21 @@ Publishes a `generic` package to current Gitea instance. Example:
* `package` - the package name * `package` - the package name
* `version` - the package version, need to be unique (unless force flag is set) * `version` - the package version, need to be unique (unless force flag is set)
* `force` - false by default; if set **deletes the whole version** of the package (all files) and then publishes instead with the same version * `force` - false by default; if set **deletes the whole version** of the package (all files) and then publishes instead with the same version
## Releasae
Create a tag and a release (if tag is not present) or a release for an existing tag.
```yaml
- id: create-release
uses: https://source.vague.tech/open-vague/ci-actions/release@feature/3-release
with:
name: Initial release
version: v0.1.0
- run: |
echo "Id: ${{ steps.create-release.outputs.release_id }}"
```
* `name` - release name
* `body` - release notes (or description)
* `version` - tag name
+5 -1
View File
@@ -5,6 +5,10 @@ inputs:
name: name:
description: release name description: release name
required: true required: true
notes:
description: release notes
required: false
default: ""
version: version:
description: release version description: release version
required: true required: true
@@ -21,6 +25,6 @@ runs:
shell: bash shell: bash
run: | run: |
RESPONSE=$(curl -X POST -H "Authorization: token ${ACTI_BOT_TOKEN}" -H "Content-Type: application/json" \ RESPONSE=$(curl -X POST -H "Authorization: token ${ACTI_BOT_TOKEN}" -H "Content-Type: application/json" \
-d "{\"draft\": false, \"prerelease\": false, \"tag_name\": \"${{ inputs.version }}\", \"name\": \"${{ inputs.name }}\"}" \ -d "{\"draft\": false, \"prerelease\": false, \"body\": \"${{ inputs.body }}\", \"tag_name\": \"${{ inputs.version }}\", \"name\": \"${{ inputs.name }}\"}" \
${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases) ${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases)
echo "id=$(echo "$RESPONSE" | jq -r .id)" >> "$GITEA_OUTPUT" echo "id=$(echo "$RESPONSE" | jq -r .id)" >> "$GITEA_OUTPUT"