From 6185893c8da6f234a44a0e5e7528d983f577fd6b Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 16:54:55 +0300 Subject: [PATCH 1/3] #4 : Implement Attach artifact to a release action + basic skeleton added --- attach/action.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 attach/action.yaml diff --git a/attach/action.yaml b/attach/action.yaml new file mode 100644 index 0000000..76e9542 --- /dev/null +++ b/attach/action.yaml @@ -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} \ No newline at end of file From 54179f470ad29d1cabd8ee4ecdf8637270cae5ec Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 16:57:26 +0300 Subject: [PATCH 2/3] #4 : Implement Attach artifact to a release action + typo fix --- attach/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attach/action.yaml b/attach/action.yaml index 76e9542..0b84781 100644 --- a/attach/action.yaml +++ b/attach/action.yaml @@ -19,6 +19,6 @@ runs: env: $NAME: ${{ inputs.name }} run: | - name="${$NAME:-${{ inputs.file }}}" + 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} \ No newline at end of file From 737ee328025a5a148037cc286e73f88844b6b80b Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 17:04:39 +0300 Subject: [PATCH 3/3] #4 : Implement Attach artifact to a release action + docs updated --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 099d76b..d3c3d73 100644 --- a/README.md +++ b/README.md @@ -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: ```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: file: some-content.json 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) * `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. @@ -34,7 +34,7 @@ The current implementation does not support moving tags, so version should be un ```yaml - 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: name: Initial release version: v0.1.0 @@ -43,5 +43,21 @@ The current implementation does not support moving tags, so version should be un ``` * `name` - release name -* `body` - release notes (or description) -* `version` - tag name \ No newline at end of file +* `body` - release notes (or description, optional) +* `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) \ No newline at end of file