#4 : Implement Attach artifact to a release action #6
@@ -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
|
||||
* `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)
|
||||
@@ -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}
|
||||
Reference in New Issue
Block a user