Skip to content

Commit

Permalink
fix: configs
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Oct 2, 2024
1 parent 18c5c30 commit 4867ae5
Showing 1 changed file with 35 additions and 24 deletions.
59 changes: 35 additions & 24 deletions electron/constants/config.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,67 @@
const { isDev } = require('../constants');

require('dotenv').config();
/**
* GitHub publish options
* @see https://www.electron.build/auto-update#githuboptions
* @type {{
* releaseType: 'draft' | 'prerelease' | 'release',
* token?: string
* } & PearlGithubUpdateOptions}
*/

/**
* Type definition for GitHub update options
* @note Required as GithubOptions is not exported as a type, only as an interface
* Pearl GitHub publish options type definition
* @see https://www.electron.build/auto-update#githuboptions
* @typedef {{
* provider: 'github',
* owner: string,
* repo: string,
* private: boolean,
* publishAutoUpdate: boolean,
* channel: string,
* vPrefixedTagName: boolean,
* protocol: "https" | "http",
* token?: string,
* allowPrerelease: boolean
* }} PearlGithubUpdateOptions
* releaseType: 'draft' | 'prerelease' | 'release'
* }} PearlGithubPublishOptions
*/

/**
* GitHub update options
* @see https://www.electron.build/auto-update#githuboptions
* @type {PearlGithubUpdateOptions}
* @warning `token` is leaked in app-update.yml if defined here,
* use {githubPublishOptions} instead if you're looking to release the app to GitHub
*/
const githubUpdateOptions = {
* @type {PearlGithubPublishOptions} */
const githubPublishOptions = {
provider: 'github',
owner: 'valory-xyz',
repo: 'olas-operate-app',
private: true, // Only set to true if the repo is private
releaseType: 'draft',
publishAutoUpdate: true, // Publishes the update to GitHub
channel: isDev ? 'dev' : 'latest', // The release channel to check for updates, e.g. 'latest', 'beta', 'alpha'
vPrefixedTagName: true,
protocol: 'https',
token: process.env.GH_TOKEN, // Token assigned temporarily during GitHub Actions
allowPrerelease: true,
channel: isDev ? 'dev' : 'latest', // The release channel to check for updates, e.g. 'latest', 'beta', 'alpha'
// token: process.env.GH_TOKEN, // Token assigned temporarily during GitHub Actions
};

/**
* GitHub publish options
* Pearl GitHub update options type definition
* @see https://www.electron.build/auto-update#githuboptions
* @type {{
* releaseType: 'draft' | 'prerelease' | 'release',
* token?: string
* } & PearlGithubUpdateOptions}
* @typedef {{
* private: boolean,
* token?: string,
* allowPrerelease: boolean
* } & PearlGithubPublishOptions} PearlGithubUpdateOptions
*/
const githubPublishOptions = {
...githubUpdateOptions,
releaseType: 'draft',
// token: process.env.GH_TOKEN, // Token assigned temporarily during GitHub Actions

/**
* GitHub update options
* @see https://www.electron.build/auto-update#githuboptions
* @type {PearlGithubUpdateOptions}
* use {githubPublishOptions} instead if you're looking to release the app to GitHub
*/
const githubUpdateOptions = {
...githubPublishOptions,
private: true, // Only set to true if the repo is private
token: process.env.GH_TOKEN, // Token assigned temporarily during GitHub Actions
allowPrerelease: true,
};

module.exports = {
Expand Down

0 comments on commit 4867ae5

Please sign in to comment.