# gitea-actions ## Setup For these actions to work properly one needs a bot account for the token. So, once the bot account is created, generate a token for it with `repository:write` and `package:write` permissions. However that's not enough, even making the bot a repository collaborator is not enough. The bot needs to have permissions on the organization level. The recommended way is to create a team in the organization that has access to all repositories and set `Releases:Write` and `Packages:Write` permissions and `Read` for all the rest (yet, strictly speaking that's not necessary) and add the bot to the team. The workflow (or jobs individually) needs to define an env variable `ACTI_BOT_TOKEN` with the bots token (as secrets do not automatically propagate into composite action context, at least it didn't work while testing). ## Publish Publishes a `generic` package to current Gitea instance. Example: ```yaml - uses: https://source.vague.tech/open-vague/ci-actions/publish@master with: file: some-content.json package: the-package version: master force: true ``` * `file` - path to the file to upload (used as uploaded file name within the package) * `package` - the package name * `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 ## Release Create a tag and a release (if tag is not present) or a release for an existing tag. The current implementation does not support moving tags, so version should be unique within the repo. ```yaml - id: create-release uses: https://source.vague.tech/open-vague/ci-actions/release@master 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, 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)