1.0.0 • Published 7 months ago

@denixjg/publisher-gitea v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Publisher Gitea

A publisher for Electron Forge that allows you to publish your application's artifacts to Gitea releases.

Installation

npm install --save-dev @denixjg/publisher-gitea

Usage

Add the following to your Forge config:

{
  publishers: [
    {
      name: '@denixjg/publisher-gitea',
      config: {
        repository: {
          owner: 'your-username',
          name: 'your-repo-name'
        },
        baseUrl: 'https://gitea.yourdomain.com',
        authToken: 'your-gitea-token',
        draft: true,
        prerelease: false,
        tagPrefix: 'v'
      }
    }
  ]
}

Configuration

OptionTypeDescriptionRequired
repository.ownerstringThe username or organization that owns the repositoryYes
repository.namestringThe name of the repositoryYes
baseUrlstringThe base URL of your Gitea instanceYes
authTokenstringAPI token with permission to upload releases (can also be set via GITEA_TOKEN environment variable)Yes
draftbooleanWhether to create the release as a draft (default: true)No
prereleasebooleanWhether to mark the release as a pre-release (default: false)No
tagPrefixstringString to prepend to the version number for the release tag (default: "v")No
forcebooleanWhether to re-upload assets if they already exist (default: false)No

Authentication

You can provide the authentication token in two ways:

  1. Via the config object: authToken: 'your-token'
  2. Via environment variable: GITEA_TOKEN=your-token

To create a token in Gitea: 1. Go to Settings > Applications 2. Generate a new token with the write:repository scope

Example

Here's a complete example of how to configure the publisher:

module.exports = {
  publishers: [
    {
      name: '@denixjg/publisher-gitea',
      config: {
        repository: {
          owner: 'acme',
          name: 'electron-app'
        },
        baseUrl: 'https://gitea.acme.com',
        authToken: process.env.GITEA_TOKEN,
        draft: true,
        prerelease: false,
        tagPrefix: 'v',
        force: false
      }
    }
  ]
}

License

MIT