config

package
v0.0.0-...-7658473 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config contains types and helpers to describe the configuration of an applereleaser project

Index

Constants

View Source
const (
	// ReleaseTypeManual refers to a manual release type.
	ReleaseTypeManual releaseType = "manual"
	// ReleaseTypeAfterApproval refers to an automatic release type to be completed after approval.
	ReleaseTypeAfterApproval releaseType = "afterApproval"
	// ReleaseTypeScheduled refers to an automatic release type to be completed after a scheduled date.
	ReleaseTypeScheduled releaseType = "scheduled"
)
View Source
const (
	// PreviewTypeAppleTV is a preview type for Apple TV.
	PreviewTypeAppleTV previewType = "appleTV"
	// PreviewTypeDesktop is a preview type for Desktop.
	PreviewTypeDesktop previewType = "desktop"
	// PreviewTypeiPad105 is a preview type for iPad 10.5.
	PreviewTypeiPad105 previewType = "ipad105"
	// PreviewTypeiPad97 is a preview type for iPad 9.7.
	PreviewTypeiPad97 previewType = "ipad97"
	// PreviewTypeiPadPro129 is a preview type for iPad Pro 12.9.
	PreviewTypeiPadPro129 previewType = "ipadPro129"
	// PreviewTypeiPadPro3Gen11 is a preview type for third-generation iPad Pro 11.
	PreviewTypeiPadPro3Gen11 previewType = "ipadPro3Gen11"
	// PreviewTypeiPadPro3Gen129 is a preview type for third-generation iPad Pro 12.9.
	PreviewTypeiPadPro3Gen129 previewType = "ipadPro3Gen129"
	// PreviewTypeiPhone35 is a preview type for iPhone 3.5.
	PreviewTypeiPhone35 previewType = "iphone35"
	// PreviewTypeiPhone40 is a preview type for iPhone 4.0.
	PreviewTypeiPhone40 previewType = "iphone40"
	// PreviewTypeiPhone47 is a preview type for iPhone 4.7.
	PreviewTypeiPhone47 previewType = "iphone47"
	// PreviewTypeiPhone55 is a preview type for iPhone 5.5.
	PreviewTypeiPhone55 previewType = "iphone55"
	// PreviewTypeiPhone58 is a preview type for iPhone 5.8.
	PreviewTypeiPhone58 previewType = "iphone58"
	// PreviewTypeiPhone65 is a preview type for iPhone 6.5.
	PreviewTypeiPhone65 previewType = "iphone65"
	// PreviewTypeWatchSeries3 is a preview type for Watch Series 3.
	PreviewTypeWatchSeries3 previewType = "watchSeries3"
	// PreviewTypeWatchSeries4 is a preview type for Watch Series 4.
	PreviewTypeWatchSeries4 previewType = "watchSeries4"
)
View Source
const (
	// ScreenshotTypeAppleTV is a screenshot type for Apple TV.
	ScreenshotTypeAppleTV screenshotType = "appleTV"
	// ScreenshotTypeDesktop is a screenshot type for Desktop.
	ScreenshotTypeDesktop screenshotType = "desktop"
	// ScreenshotTypeiPad105 is a screenshot type for iPad 10.5.
	ScreenshotTypeiPad105 screenshotType = "ipad105"
	// ScreenshotTypeiPad97 is a screenshot type for iPad 9.7.
	ScreenshotTypeiPad97 screenshotType = "ipad97"
	// ScreenshotTypeiPadPro129 is a screenshot type for iPad Pro 12.9.
	ScreenshotTypeiPadPro129 screenshotType = "ipadPro129"
	// ScreenshotTypeiPadPro3Gen11 is a screenshot type for third-generation iPad Pro 11.
	ScreenshotTypeiPadPro3Gen11 screenshotType = "ipadPro3Gen11"
	// ScreenshotTypeiPadPro3Gen129 is a screenshot type for third-generation iPad Pro 12.9.
	ScreenshotTypeiPadPro3Gen129 screenshotType = "ipadPro3Gen129"
	// ScreenshotTypeiPhone35 is a screenshot type for iPhone 3.5.
	ScreenshotTypeiPhone35 screenshotType = "iphone35"
	// ScreenshotTypeiPhone40 is a screenshot type for iPhone 4.0.
	ScreenshotTypeiPhone40 screenshotType = "iphone40"
	// ScreenshotTypeiPhone47 is a screenshot type for iPhone 4.7.
	ScreenshotTypeiPhone47 screenshotType = "iphone47"
	// ScreenshotTypeiPhone55 is a screenshot type for iPhone 5.5.
	ScreenshotTypeiPhone55 screenshotType = "iphone55"
	// ScreenshotTypeiPhone58 is a screenshot type for iPhone 5.8.
	ScreenshotTypeiPhone58 screenshotType = "iphone58"
	// ScreenshotTypeiPhone65 is a screenshot type for iPhone 6.5.
	ScreenshotTypeiPhone65 screenshotType = "iphone65"
	// ScreenshotTypeWatchSeries3 is a screenshot type for Watch Series 3.
	ScreenshotTypeWatchSeries3 screenshotType = "watchSeries3"
	// ScreenshotTypeWatchSeries4 is a screenshot type for Watch Series 4.
	ScreenshotTypeWatchSeries4 screenshotType = "watchSeries4"
	// ScreenshotTypeiMessageiPad105 is a screenshot type for iMessage apps on iPad 10.5.
	ScreenshotTypeiMessageiPad105 screenshotType = "ipad105imessage"
	// ScreenshotTypeiMessageiPad97 is a screenshot type for iMessage apps on iPad 9.7.
	ScreenshotTypeiMessageiPad97 screenshotType = "ipad97imessage"
	// ScreenshotTypeiMessageiPadPro129 is a screenshot type for iMessage apps on iPad Pro 12.9.
	ScreenshotTypeiMessageiPadPro129 screenshotType = "ipadPro129imessage"
	// ScreenshotTypeiMessageiPadPro3Gen11 is a screenshot type for iMessage apps on third-generation iPad Pro 11.
	ScreenshotTypeiMessageiPadPro3Gen11 screenshotType = "ipadPro3Gen11imessage"
	// ScreenshotTypeiMessageiPadPro3Gen129 is a screenshot type for iMessage apps on third-generation iPad Pro 12.9.
	ScreenshotTypeiMessageiPadPro3Gen129 screenshotType = "ipadPro3Gen129imessage"
	// ScreenshotTypeiMessageiPhone40 is a screenshot type for iMessage apps on iPhone 4.0.
	ScreenshotTypeiMessageiPhone40 screenshotType = "iphone40imessage"
	// ScreenshotTypeiMessageiPhone47 is a screenshot type for iMessage apps on iPhone 4.7.
	ScreenshotTypeiMessageiPhone47 screenshotType = "iphone47imessage"
	// ScreenshotTypeiMessageiPhone55 is a screenshot type for iMessage apps on iPhone 5.5.
	ScreenshotTypeiMessageiPhone55 screenshotType = "iphone55imessage"
	// ScreenshotTypeiMessageiPhone58 is a screenshot type for iMessage apps on iPhone 5.8.
	ScreenshotTypeiMessageiPhone58 screenshotType = "iphone58imessage"
	// ScreenshotTypeiMessageiPhone65 is a screenshot type for iMessage apps on iPhone 6.5.
	ScreenshotTypeiMessageiPhone65 screenshotType = "iphone65imessage"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Bundle ID of the app. Required.
	BundleID string `yaml:"id"`
	// Primary locale of the app.
	PrimaryLocale         string           `yaml:"primaryLocale,omitempty"`
	UsesThirdPartyContent *bool            `yaml:"usesThirdPartyContent,omitempty"`
	Availability          *Availability    `yaml:"availability,omitempty"`
	Localizations         AppLocalizations `yaml:"localizations"`
	Versions              Version          `yaml:"versions"`
	Testflight            TestflightForApp `yaml:"testflight"`
}

App outlines general information about your app, primarily for querying purposes.

type AppLocalization

type AppLocalization struct {
	// Name of the app in this locale. Templated.
	Name string `yaml:"name"`
	// Subtitle of the app in this locale. Templated.
	Subtitle string `yaml:"subtitle,omitempty"`
	// Privacy policy text if not using a URL. Templated.
	PrivacyPolicyText string `yaml:"privacyPolicyText,omitempty"`
	// Privacy policy URL if not using a text body. Templated.
	PrivacyPolicyURL string `yaml:"privacyPolicyURL,omitempty"`
}

AppLocalization contains localized details for your App Store listing.

type AppLocalizations

type AppLocalizations map[string]AppLocalization

AppLocalizations is a map of locales to AppLocalization objects.

type Availability

type Availability struct {
	// AvailableInNewTerritories refers to whether or not the app should be made automaticaly available
	// in new App Store territories, as Apple makes new ones available.
	AvailableInNewTerritories *bool `yaml:"availableInNewTerritories,omitempty"`
	// Pricing is a list of PriceSchedules that describe the pricing details of your app.
	Pricing []PriceSchedule `yaml:"priceTiers,omitempty"`
	// Territories corresponds to the IDs of territories as they're referred to in App Store Connect.
	//
	// https://help.apple.com/app-store-connect/#/dev997f9cf7c
	Territories []string `yaml:"territories,omitempty"`
}

Availability wraps aspects of app availability, such as territories and pricing.

type BetaGroup

type BetaGroup struct {
	// Beta group name.
	Name                  string       `yaml:"group"`
	EnablePublicLink      bool         `yaml:"publicLinkEnabled,omitempty"`
	EnablePublicLinkLimit bool         `yaml:"publicLinkLimitEnabled,omitempty"`
	FeedbackEnabled       bool         `yaml:"feedbackEnabled,omitempty"`
	PublicLinkLimit       int          `yaml:"publicLinkLimit,omitempty"`
	Testers               []BetaTester `yaml:"testers"`
}

BetaGroup describes a beta group in Testflight that should be kept in sync and used with this app.

type BetaTester

type BetaTester struct {
	// Beta tester email.
	Email string `yaml:"email"`
	// Beta tester first name.
	FirstName string `yaml:"firstName,omitempty"`
	// Beta tester last name.
	LastName string `yaml:"lastName,omitempty"`
}

BetaTester describes an individual beta tester that should have access to this app.

type ContactPerson

type ContactPerson struct {
	// Contact email. Required. Templated.
	Email string `yaml:"email"`
	// Contact first name. Required. Templated.
	FirstName string `yaml:"firstName"`
	// Contact last name. Required. Templated.
	LastName string `yaml:"lastName"`
	// Contact phone number. Required. Templated.
	Phone string `yaml:"phone"`
}

ContactPerson is a point of contact for App Store reviewers to reach out to in case of an issue.

type DemoAccount

type DemoAccount struct {
	Required bool `yaml:"isRequired"`
	// Demo account name or login. Templated.
	Name string `yaml:"name,omitempty"`
	// Demo account password. Templated.
	Password string `yaml:"password,omitempty"`
}

DemoAccount contains account credentials for App Store reviewers to assess your apps.

type File

type File struct {
	// Path to a file on-disk. Templated.
	Path string `yaml:"path"`
}

File refers to a file on disk by name.

type IDFADeclaration

type IDFADeclaration struct {
	AttributesActionWithPreviousAd        bool `yaml:"attributesActionWithPreviousAd"`
	AttributesAppInstallationToPreviousAd bool `yaml:"attributesAppInstallationToPreviousAd"`
	HonorsLimitedAdTracking               bool `yaml:"honorsLimitedAdTracking"`
	ServesAds                             bool `yaml:"servesAds"`
}

IDFADeclaration outlines regulatory information for Apple to use to handle your apps' use of tracking identifiers. Implicitly enables `usesIdfa` when creating an app store version.

type Platform

type Platform string

Platform represents a supported platform type from App Store Connect.

const (
	// PlatformiOS refers to the iOS platform.
	PlatformiOS Platform = "iOS"
	// PlatformMacOS refers to the macOS platform.
	PlatformMacOS Platform = "macOS"
	// PlatformTvOS refers to the tvOS platform.
	PlatformTvOS Platform = "tvOS"
)

func (Platform) APIValue

func (p Platform) APIValue() (asc.Platform, error)

APIValue returns the corresponding API value type for this config type.

type Preview

type Preview struct {
	File                 `yaml:",inline"`
	MIMEType             string `yaml:"mimeType,omitempty"`
	PreviewFrameTimeCode string `yaml:"previewFrameTimeCode,omitempty"`
}

Preview is an expansion of File that defines a new app preview asset.

type PreviewSets

type PreviewSets map[previewType][]Preview

PreviewSets is a map of preview types to []Preview slices.

func (PreviewSets) GetPreviews

func (s PreviewSets) GetPreviews(previewType asc.PreviewType) []Preview

GetPreviews fetches the value from the map corresponding to the API value.

type PriceSchedule

type PriceSchedule struct {
	// Tier corresponds to a representation of a tier on the App Store Pricing Matrix.
	// For example, Tier 1 should be represented as "1" and the Free tier should be
	// represented as "0".
	//
	// https://appstoreconnect.apple.com/apps/pricingmatrix
	Tier string `yaml:"tier"`
	// StartDate is the start date a price schedule should take effect. Set to nil to have it take
	// effect immediately.
	StartDate *time.Time `yaml:"startDate,omitempty"`
	// EndDate is the end date a price schedule should be in effect until. Field is currently a no-op.
	EndDate *time.Time `yaml:"endDate,omitempty"`
}

PriceSchedule represents pricing availability information that an app should be immediately configured to.

type Project

type Project struct {
	// Name of the project, used for logging.
	Name       string         `yaml:"name"`
	Testflight Testflight     `yaml:"testflight"`
	Apps       map[string]App `yaml:"apps"`
}

Project is the top level configuration type.

func Load

func Load(file string) (config Project, err error)

Load config file.

func LoadReader

func LoadReader(fd io.Reader) (config Project, err error)

LoadReader config via io.Reader.

func (*Project) AppsMatching

func (p *Project) AppsMatching(keys []string, shouldIncludeAll bool) []string

AppsMatching returns an array of keys in the Project matching the app names, or all names if the flag is set.

func (*Project) Copy

func (p *Project) Copy() (copy Project, err error)

Copy performs a costly deep-copy of the entire project structure.

func (Project) String

func (p Project) String() (string, error)

type Repo

type Repo struct {
	Owner string `yaml:",omitempty"`
	Name  string `yaml:",omitempty"`
}

Repo represents any kind of repo (github, gitlab, etc).

type ReviewDetails

type ReviewDetails struct {
	Contact     *ContactPerson `yaml:"contact,omitempty"`
	DemoAccount *DemoAccount   `yaml:"demoAccount,omitempty"`
	// Notes for the reviewer. Templated.
	Notes       string `yaml:"notes,omitempty"`
	Attachments []File `yaml:"attachments,omitempty"`
}

ReviewDetails contains information for App Store reviewers to use in their assessment.

type ScreenshotSets

type ScreenshotSets map[screenshotType][]File

ScreenshotSets is a map of screenshot types to []File slices.

func (ScreenshotSets) GetScreenshots

func (s ScreenshotSets) GetScreenshots(screenshotType asc.ScreenshotDisplayType) []File

GetScreenshots fetches the value from the map corresponding to the API value.

type Testflight

type Testflight struct {
	BetaGroups  []BetaGroup  `yaml:"betaGroups"`
	BetaTesters []BetaTester `yaml:"betaTesters"`
}

Testflight represents information about a Testflight configuration for an entire App Store Connect team.

type TestflightForApp

type TestflightForApp struct {
	EnableAutoNotify bool `yaml:"enableAutoNotify"`
	// Beta license agreement text. Templated.
	LicenseAgreement string                  `yaml:"licenseAgreement"`
	Localizations    TestflightLocalizations `yaml:"localizations"`
	BetaGroups       []string                `yaml:"betaGroups,omitempty"`
	BetaTesters      []BetaTester            `yaml:"betaTesters,omitempty"`
	ReviewDetails    *ReviewDetails          `yaml:"reviewDetails,omitempty"`
}

TestflightForApp represents configuration for beta distribution of apps.

type TestflightLocalization

type TestflightLocalization struct {
	// Beta build description in this locale. Templated.
	Description string `yaml:"description"`
	// Email for testers to provide feedback to in this locale. Templated.
	FeedbackEmail string `yaml:"feedbackEmail,omitempty"`
	// Marketing URL to use in this locale. Templated.
	MarketingURL string `yaml:"marketingURL,omitempty"`
	// Privacy policy URL to use in this locale. Templated.
	PrivacyPolicyURL string `yaml:"privacyPolicyURL,omitempty"`
	// Privacy policy text to use on tvOS in this locale. Templated.
	TVOSPrivacyPolicy string `yaml:"tvOSPrivacyPolicy,omitempty"`
	// "Whats New" release note text to use in this locale. Templated.
	WhatsNew string `yaml:"whatsNew,omitempty"`
}

TestflightLocalization contains localized details for the listing of a specific build in the Testflight app.

type TestflightLocalizations

type TestflightLocalizations map[string]TestflightLocalization

TestflightLocalizations is a map of locales to TestflightLocalization objects.

type Version

type Version struct {
	Platform      Platform             `yaml:"platform"`
	Localizations VersionLocalizations `yaml:"localizations"`
	// Copyright information to display on the listing. Templated.
	Copyright            string           `yaml:"copyright,omitempty"`
	EarliestReleaseDate  *time.Time       `yaml:"earliestReleaseDate,omitempty"`
	ReleaseType          releaseType      `yaml:"releaseType,omitempty"`
	PhasedReleaseEnabled bool             `yaml:"enablePhasedRelease,omitempty"`
	IDFADeclaration      *IDFADeclaration `yaml:"idfaDeclaration,omitempty"`
	RoutingCoverage      *File            `yaml:"routingCoverage,omitempty"`
	ReviewDetails        *ReviewDetails   `yaml:"reviewDetails,omitempty"`
}

Version outlines the general details of your app store version as it will be represented on the App Store.

type VersionLocalization

type VersionLocalization struct {
	// App description in this locale. Templated.
	Description string `yaml:"description"`
	// App keywords in this locale. Templated.
	Keywords string `yaml:"keywords,omitempty"`
	// Marketing URL to use in this locale. Templated.
	MarketingURL string `yaml:"marketingURL,omitempty"`
	// Promotional text to use in this locale. Can be updated without a requiring a new build. Templated.
	PromotionalText string `yaml:"promotionalText,omitempty"`
	// Support URL to use in this locale. Templated.
	SupportURL string `yaml:"supportURL,omitempty"`
	// "Whats New" release note text to use in this locale. Templated.
	WhatsNewText   string         `yaml:"whatsNew,omitempty"`
	PreviewSets    PreviewSets    `yaml:"previewSets,omitempty"`
	ScreenshotSets ScreenshotSets `yaml:"screenshotSets,omitempty"`
}

VersionLocalization contains localized details for the listing of a specific version on the App Store.

type VersionLocalizations

type VersionLocalizations map[string]VersionLocalization

VersionLocalizations is a map of locales to VersionLocalization objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL