Merge pull request '#4 : Implement Attach artifact to a release action' (#6) from feature/4-attach into master

Reviewed-on: #6
This commit was merged in pull request #6.
This commit is contained in:
2026-09-28 17:04:55 +03:00
2 changed files with 45 additions and 5 deletions
+20 -4
View File
@@ -13,7 +13,7 @@ The workflow (or jobs individually) needs to define an env variable `ACTI_BOT_TO
Publishes a `generic` package to current Gitea instance. Example: Publishes a `generic` package to current Gitea instance. Example:
```yaml ```yaml
- uses: https://source.vague.tech/open-vague/ci-actions/publish@feature/1-publish - uses: https://source.vague.tech/open-vague/ci-actions/publish@master
with: with:
file: some-content.json file: some-content.json
package: the-package package: the-package
@@ -26,7 +26,7 @@ Publishes a `generic` package to current Gitea instance. Example:
* `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 ## Release
Create a tag and a release (if tag is not present) or a release for an existing tag. Create a tag and a release (if tag is not present) or a release for an existing tag.
@@ -34,7 +34,7 @@ The current implementation does not support moving tags, so version should be un
```yaml ```yaml
- id: create-release - id: create-release
uses: https://source.vague.tech/open-vague/ci-actions/release@feature/3-release uses: https://source.vague.tech/open-vague/ci-actions/release@master
with: with:
name: Initial release name: Initial release
version: v0.1.0 version: v0.1.0
@@ -43,5 +43,21 @@ The current implementation does not support moving tags, so version should be un
``` ```
* `name` - release name * `name` - release name
* `body` - release notes (or description) * `body` - release notes (or description, optional)
* `version` - tag name * `version` - tag name
## Attach
Attach an artefact file to an existing release. Important to know, the operation is not idempotent: if called twice will upload the file two times, creating two identical attachments.
```yaml
- uses: https://source.vague.tech/open-vague/ci-actions/attach@master
with:
release: 142
name: Coverage report
file: cover.out
```
* `release` - release id (use the output `release_id` for the **release** action)
* `file` - path to file
* `name` - uploaded artefact name replacement (optional)
+24
View File
@@ -0,0 +1,24 @@
name: attach artefact to release
description: attach file to an existing release in gitea
inputs:
release:
description: release id
required: true
file:
description: file name to attach
required: true
name:
description: artefact name override
required: false
runs:
using: composite
steps:
- shell: bash
env:
$NAME: ${{ inputs.name }}
run: |
name="${NAME:-${{ inputs.file }}}"
curl --fail-with-body -X POST -H "Authorization: token ${ACTI_BOT_TOKEN}" -F "attachment=@${{ inputs.file }}" \
${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/${{ inputs.release }}/assets?name=${name}