-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.go
1671 lines (1474 loc) · 91.8 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package config contains the model and loader of the goreleaser configuration
// file.
package config
import (
"encoding/json"
"fmt"
"io/fs"
"os"
"strings"
"time"
)
const (
// PartialByGoos runs the only builds that match the current GOOS.
PartialByGoos = "goos"
// PartialByTarget runs the single build target that matches the current
// GOOS and GOARCH.
PartialByTarget = "target"
)
type Versioned struct {
Version int
}
// Partial specifies how a build should be split when using `--split`.
type Partial struct {
// either target or goos for now
By string `yaml:"by,omitempty" json:"by,omitempty" jsonschema:"enum=goos,enum=target,default=goos"`
Target string `yaml:"-" json:"-"`
}
// Git configs.
type Git struct {
TagSort string `yaml:"tag_sort,omitempty" json:"tag_sort,omitempty" jsonschema:"enum=-version:refname,enum=-version:creatordate,enum=semver,default=-version:refname"`
PrereleaseSuffix string `yaml:"prerelease_suffix,omitempty" json:"prerelease_suffix,omitempty"`
IgnoreTags []string `yaml:"ignore_tags,omitempty" json:"ignore_tags,omitempty"`
// pro-only
IgnoreTagPrefixes []string `yaml:"ignore_tag_prefixes,omitempty" json:"ignore_tag_prefixes,omitempty"`
}
// GitHubURLs holds the URLs to be used when using github enterprise.
type GitHubURLs struct {
API string `yaml:"api,omitempty" json:"api,omitempty"`
Upload string `yaml:"upload,omitempty" json:"upload,omitempty"`
Download string `yaml:"download,omitempty" json:"download,omitempty"`
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty" json:"skip_tls_verify,omitempty"`
}
// GitLabURLs holds the URLs to be used when using gitlab ce/enterprise.
type GitLabURLs struct {
API string `yaml:"api,omitempty" json:"api,omitempty"`
Download string `yaml:"download,omitempty" json:"download,omitempty"`
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty" json:"skip_tls_verify,omitempty"`
UsePackageRegistry bool `yaml:"use_package_registry,omitempty" json:"use_package_registry,omitempty"`
UseJobToken bool `yaml:"use_job_token,omitempty" json:"use_job_token,omitempty"`
}
// GiteaURLs holds the URLs to be used when using gitea.
type GiteaURLs struct {
API string `yaml:"api,omitempty" json:"api,omitempty"`
Download string `yaml:"download,omitempty" json:"download,omitempty"`
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty" json:"skip_tls_verify,omitempty"`
}
// Repo represents any kind of repo (github, gitlab, etc).
// to upload releases into.
type Repo struct {
Owner string `yaml:"owner,omitempty" json:"owner,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
RawURL string `yaml:"-" json:"-"`
}
// String of the repo, e.g. owner/name.
func (r Repo) String() string {
if r.isSCM() {
return r.Owner + "/" + r.Name
}
return r.Owner
}
// CheckSCM returns an error if the given url is not a valid scm url.
func (r Repo) CheckSCM() error {
if r.isSCM() {
return nil
}
return fmt.Errorf("invalid scm url: %s", r.RawURL)
}
// isSCM returns true if the repo has both an owner and name.
func (r Repo) isSCM() bool {
return r.Owner != "" && r.Name != ""
}
// RepoRef represents any kind of repo which may differ
// from the one we are building from and may therefore
// also require separate authentication
// e.g. Homebrew Tap, Scoop bucket.
type RepoRef struct {
Owner string `yaml:"owner,omitempty" json:"owner,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Token string `yaml:"token,omitempty" json:"token,omitempty"`
TokenType string `yaml:"token_type,omitempty" json:"token_type,omitempty" jsonschema:"enum=github,enum=gitlab,enum=gitea"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
Git GitRepoRef `yaml:"git,omitempty" json:"git,omitempty"`
PullRequest PullRequest `yaml:"pull_request,omitempty" json:"pull_request,omitempty"`
}
type GitRepoRef struct {
URL string `yaml:"url,omitempty" json:"url,omitempty"`
SSHCommand string `yaml:"ssh_command,omitempty" json:"ssh_command,omitempty"`
PrivateKey string `yaml:"private_key,omitempty" json:"private_key,omitempty"`
}
type PullRequestBase struct {
Owner string `yaml:"owner,omitempty" json:"owner,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
}
// type alias to prevent stack overflowing in the custom unmarshaler.
type pullRequestBase PullRequestBase
// UnmarshalYAML is a custom unmarshaler that accept brew deps in both the old and new format.
func (a *PullRequestBase) UnmarshalYAML(unmarshal func(interface{}) error) error {
var str string
if err := unmarshal(&str); err == nil {
a.Branch = str
return nil
}
var base pullRequestBase
if err := unmarshal(&base); err != nil {
return err
}
a.Branch = base.Branch
a.Owner = base.Owner
a.Name = base.Name
return nil
}
type PullRequest struct {
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
Base PullRequestBase `yaml:"base,omitempty" json:"base,omitempty"`
Draft bool `yaml:"draft,omitempty" json:"draft,omitempty"`
// pro only
CheckBoxes bool `yaml:"check_boxes,omitempty" json:"check_boxes,omitempty"`
}
// HomebrewDependency represents Homebrew dependency.
type HomebrewDependency struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
OS string `yaml:"os,omitempty" json:"os,omitempty" jsonschema:"enum=mac,enum=linux"`
}
// type alias to prevent stack overflowing in the custom unmarshaler.
type homebrewDependency HomebrewDependency
// UnmarshalYAML is a custom unmarshaler that accept brew deps in both the old and new format.
func (a *HomebrewDependency) UnmarshalYAML(unmarshal func(interface{}) error) error {
var str string
if err := unmarshal(&str); err == nil {
a.Name = str
return nil
}
var dep homebrewDependency
if err := unmarshal(&dep); err != nil {
return err
}
a.Name = dep.Name
a.Type = dep.Type
a.Version = dep.Version
a.OS = dep.OS
return nil
}
type AUR struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
Maintainers []string `yaml:"maintainers,omitempty" json:"maintainers,omitempty"`
Contributors []string `yaml:"contributors,omitempty" json:"contributors,omitempty"`
Provides []string `yaml:"provides,omitempty" json:"provides,omitempty"`
Conflicts []string `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
Depends []string `yaml:"depends,omitempty" json:"depends,omitempty"`
OptDepends []string `yaml:"optdepends,omitempty" json:"optdepends,omitempty"`
Backup []string `yaml:"backup,omitempty" json:"backup,omitempty"`
Rel string `yaml:"rel,omitempty" json:"rel,omitempty"`
Package string `yaml:"package,omitempty" json:"package,omitempty"`
GitURL string `yaml:"git_url,omitempty" json:"git_url,omitempty"`
GitSSHCommand string `yaml:"git_ssh_command,omitempty" json:"git_ssh_command,omitempty"`
PrivateKey string `yaml:"private_key,omitempty" json:"private_key,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Directory string `yaml:"directory,omitempty" json:"directory,omitempty"`
}
type AURSource struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
Maintainers []string `yaml:"maintainers,omitempty" json:"maintainers,omitempty"`
Contributors []string `yaml:"contributors,omitempty" json:"contributors,omitempty"`
Arches []string `yaml:"arches,omitempty" json:"arches,omitempty"`
Provides []string `yaml:"provides,omitempty" json:"provides,omitempty"`
Conflicts []string `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
Depends []string `yaml:"depends,omitempty" json:"depends,omitempty"`
OptDepends []string `yaml:"optdepends,omitempty" json:"optdepends,omitempty"`
MakeDepends []string `yaml:"makedepends,omitempty" json:"makedepends,omitempty"`
Backup []string `yaml:"backup,omitempty" json:"backup,omitempty"`
Rel string `yaml:"rel,omitempty" json:"rel,omitempty"`
Prepare string `yaml:"prepare,omitempty" json:"prepare,omitempty"`
Build string `yaml:"build,omitempty" json:"build,omitempty"`
Package string `yaml:"package,omitempty" json:"package,omitempty"`
GitURL string `yaml:"git_url,omitempty" json:"git_url,omitempty"`
GitSSHCommand string `yaml:"git_ssh_command,omitempty" json:"git_ssh_command,omitempty"`
PrivateKey string `yaml:"private_key,omitempty" json:"private_key,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Directory string `yaml:"directory,omitempty" json:"directory,omitempty"`
}
// Homebrew contains the brew section.
type Homebrew struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Repository RepoRef `yaml:"repository,omitempty" json:"repository,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
Directory string `yaml:"directory,omitempty" json:"directory,omitempty"`
Caveats string `yaml:"caveats,omitempty" json:"caveats,omitempty"`
Install string `yaml:"install,omitempty" json:"install,omitempty"`
ExtraInstall string `yaml:"extra_install,omitempty" json:"extra_install,omitempty"`
PostInstall string `yaml:"post_install,omitempty" json:"post_install,omitempty"`
Dependencies []HomebrewDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
Test string `yaml:"test,omitempty" json:"test,omitempty"`
Conflicts []string `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
DownloadStrategy string `yaml:"download_strategy,omitempty" json:"download_strategy,omitempty"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
URLHeaders []string `yaml:"url_headers,omitempty" json:"url_headers,omitempty"`
CustomRequire string `yaml:"custom_require,omitempty" json:"custom_require,omitempty"`
CustomBlock string `yaml:"custom_block,omitempty" json:"custom_block,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Goarm string `yaml:"goarm,omitempty" json:"goarm,omitempty" jsonschema:"oneof_type=string;integer"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
// Pro-only
AlternativeNames []string `yaml:"alternative_names,omitempty" json:"alternative_names,omitempty"`
App string `yaml:"app,omitempty" json:"app,omitempty"`
}
type Nix struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Repository RepoRef `yaml:"repository,omitempty" json:"repository,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
Install string `yaml:"install,omitempty" json:"install,omitempty"`
ExtraInstall string `yaml:"extra_install,omitempty" json:"extra_install,omitempty"`
PostInstall string `yaml:"post_install,omitempty" json:"post_install,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
Dependencies []NixDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
}
type NixDependency struct {
Name string `yaml:"name" json:"name"`
OS string `yaml:"os,omitempty" json:"os,omitempty" jsonschema:"enum=linux,enum=darwin"`
}
func (a *NixDependency) UnmarshalYAML(unmarshal func(interface{}) error) error {
var str string
if err := unmarshal(&str); err == nil {
a.Name = str
return nil
}
type t NixDependency
var dep t
if err := unmarshal(&dep); err != nil {
return err
}
a.Name = dep.Name
a.OS = dep.OS
return nil
}
type Winget struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
PackageIdentifier string `yaml:"package_identifier,omitempty" json:"package_identifier,omitempty"`
Publisher string `yaml:"publisher" json:"publisher"`
PublisherURL string `yaml:"publisher_url,omitempty" json:"publisher_url,omitempty"`
PublisherSupportURL string `yaml:"publisher_support_url,omitempty" json:"publisher_support_url,omitempty"`
Copyright string `yaml:"copyright,omitempty" json:"copyright,omitempty"`
CopyrightURL string `yaml:"copyright_url,omitempty" json:"copyright_url,omitempty"`
Author string `yaml:"author,omitempty" json:"author,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Repository RepoRef `yaml:"repository" json:"repository"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
ShortDescription string `yaml:"short_description" json:"short_description"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
LicenseURL string `yaml:"license_url,omitempty" json:"license_url,omitempty"`
ReleaseNotes string `yaml:"release_notes,omitempty" json:"release_notes,omitempty"`
ReleaseNotesURL string `yaml:"release_notes_url,omitempty" json:"release_notes_url,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Dependencies []WingetDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
// pro-only
ProductCode string `yaml:"product_code,omitempty" json:"product_code,omitempty"`
Use string `yaml:"use,omitempty" json:"use,omitempty" jsonschema:"enum=archive,enum=binary,enum=msi"`
}
type WingetDependency struct {
PackageIdentifier string `yaml:"package_identifier" json:"package_identifier"`
MinimumVersion string `yaml:"minimum_version,omitempty" json:"minimum_version,omitempty"`
}
// Krew contains the krew section.
type Krew struct {
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Repository RepoRef `yaml:"repository,omitempty" json:"repository,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
Caveats string `yaml:"caveats,omitempty" json:"caveats,omitempty"`
ShortDescription string `yaml:"short_description,omitempty" json:"short_description,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
Goarm string `yaml:"goarm,omitempty" json:"goarm,omitempty" jsonschema:"oneof_type=string;integer"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
}
// Ko contains the ko section
type Ko struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Build string `yaml:"build,omitempty" json:"build,omitempty"`
Main string `yaml:"main,omitempty" json:"main,omitempty"`
WorkingDir string `yaml:"working_dir,omitempty" json:"working_dir,omitempty"`
BaseImage string `yaml:"base_image,omitempty" json:"base_image,omitempty"`
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
User string `yaml:"user,omitempty" json:"user,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty" jsonschema:"deprecated=true"` // Deprecated: use [Repositories].
Repositories []string `yaml:"repositories,omitempty" json:"repositories,omitempty"`
Platforms []string `yaml:"platforms,omitempty" json:"platforms,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
CreationTime string `yaml:"creation_time,omitempty" json:"creation_time,omitempty"`
KoDataCreationTime string `yaml:"ko_data_creation_time,omitempty" json:"ko_data_creation_time,omitempty"`
SBOM string `yaml:"sbom,omitempty" json:"sbom,omitempty"`
Ldflags []string `yaml:"ldflags,omitempty" json:"ldflags,omitempty"`
Flags []string `yaml:"flags,omitempty" json:"flags,omitempty"`
Env []string `yaml:"env,omitempty" json:"env,omitempty"`
Bare bool `yaml:"bare,omitempty" json:"bare,omitempty"`
PreserveImportPaths bool `yaml:"preserve_import_paths,omitempty" json:"preserve_import_paths,omitempty"`
BaseImportPaths bool `yaml:"base_import_paths,omitempty" json:"base_import_paths,omitempty"`
}
// Scoop contains the scoop.sh section.
type Scoop struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Repository RepoRef `yaml:"repository,omitempty" json:"repository,omitempty"`
Directory string `yaml:"directory,omitempty" json:"directory,omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"`
CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"`
Persist []string `yaml:"persist,omitempty" json:"persist,omitempty"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
PreInstall []string `yaml:"pre_install,omitempty" json:"pre_install,omitempty"`
PostInstall []string `yaml:"post_install,omitempty" json:"post_install,omitempty"`
Depends []string `yaml:"depends,omitempty" json:"depends,omitempty"`
Shortcuts [][]string `yaml:"shortcuts,omitempty" json:"shortcuts,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
// pro-only
Use string `yaml:"use,omitempty" json:"use,omitempty" jsonschema:"enum=archive,enum=msi,default=archive"`
}
// CommitAuthor is the author of a Git commit.
type CommitAuthor struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Email string `yaml:"email,omitempty" json:"email,omitempty"`
}
// BuildHooks define actions to run before and/or after something.
type BuildHooks struct { // renamed on pro
Pre string `yaml:"pre,omitempty" json:"pre,omitempty"`
Post string `yaml:"post,omitempty" json:"post,omitempty"`
}
// IgnoredBuild represents a build ignored by the user.
type IgnoredBuild struct {
Goos string `yaml:"goos,omitempty" json:"goos,omitempty"`
Goarch string `yaml:"goarch,omitempty" json:"goarch,omitempty"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Go386 string `yaml:"go386,omitempty" json:"go386,omitempty"`
Goarm string `yaml:"goarm,omitempty" json:"goarm,omitempty" jsonschema:"oneof_type=string;integer"`
Goarm64 string `yaml:"goarm64,omitempty" json:"goarm64,omitempty"`
Gomips string `yaml:"gomips,omitempty" json:"gomips,omitempty"`
Goppc64 string `yaml:"goppc64,omitempty" json:"goppc64,omitempty"`
Goriscv64 string `yaml:"goriscv64,omitempty" json:"goriscv64,omitempty"`
}
// StringArray is a wrapper for an array of strings.
type StringArray []string
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
var strings []string
if err := unmarshal(&strings); err != nil {
var str string
if err := unmarshal(&str); err != nil {
return err
}
*a = []string{str}
} else {
*a = strings
}
return nil
}
// FlagArray is a wrapper for an array of strings.
type FlagArray []string
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
var flags []string
if err := unmarshal(&flags); err != nil {
var flagstr string
if err := unmarshal(&flagstr); err != nil {
return err
}
*a = strings.Fields(flagstr)
} else {
*a = flags
}
return nil
}
// Build contains the build configuration section.
type Build struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Goos []string `yaml:"goos,omitempty" json:"goos,omitempty"`
Goarch []string `yaml:"goarch,omitempty" json:"goarch,omitempty"`
Goamd64 []string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Go386 []string `yaml:"go386,omitempty" json:"go386,omitempty"`
Goarm []string `yaml:"goarm,omitempty" json:"goarm,omitempty"`
Goarm64 []string `yaml:"goarm64,omitempty" json:"goarm64,omitempty"`
Gomips []string `yaml:"gomips,omitempty" json:"gomips,omitempty"`
Goppc64 []string `yaml:"goppc64,omitempty" json:"goppc64,omitempty"`
Goriscv64 []string `yaml:"goriscv64,omitempty" json:"goriscv64,omitempty"`
Targets []string `yaml:"targets,omitempty" json:"targets,omitempty"`
Ignore []IgnoredBuild `yaml:"ignore,omitempty" json:"ignore,omitempty"`
Dir string `yaml:"dir,omitempty" json:"dir,omitempty"`
Main string `yaml:"main,omitempty" json:"main,omitempty"`
Binary string `yaml:"binary,omitempty" json:"binary,omitempty"`
Hooks BuildHookConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
Builder string `yaml:"builder,omitempty" json:"builder,omitempty" jsonschema:"enum=,enum=go,enum=rust,enum=zig,enum=prebuilt"`
ModTimestamp string `yaml:"mod_timestamp,omitempty" json:"mod_timestamp,omitempty"`
Skip string `yaml:"skip,omitempty" json:"skip,omitempty" jsonschema:"oneof_type=string;boolean"`
GoBinary string `yaml:"gobinary,omitempty" json:"gobinary,omitempty"` // Deprecated: use [Tool].
Tool string `yaml:"tool,omitempty" json:"tool,omitempty"`
Command string `yaml:"command,omitempty" json:"command,omitempty"`
NoUniqueDistDir string `yaml:"no_unique_dist_dir,omitempty" json:"no_unique_dist_dir,omitempty" jsonschema:"oneof_type=string;boolean"`
NoMainCheck bool `yaml:"no_main_check,omitempty" json:"no_main_check,omitempty"`
UnproxiedMain string `yaml:"-" json:"-"` // used by gomod.proxy
UnproxiedDir string `yaml:"-" json:"-"` // used by gomod.proxy
BuildDetails `yaml:",inline" json:",inline"`
BuildDetailsOverrides []BuildDetailsOverride `yaml:"overrides,omitempty" json:"overrides,omitempty"`
// pro options
PreBuilt PreBuiltOptions `yaml:"prebuilt,omitempty" json:"prebuilt,omitempty"`
}
type PreBuiltOptions struct { // pro only
Path string `yaml:"path,omitempty" json:"path,omitempty"`
}
type BuildDetailsOverride struct {
Goos string `yaml:"goos" json:"goos"`
Goarch string `yaml:"goarch" json:"goarch"`
Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Go386 string `yaml:"go386,omitempty" json:"go386,omitempty"`
Goarm64 string `yaml:"goarm64,omitempty" json:"goarm64,omitempty"`
Goarm string `yaml:"goarm,omitempty" json:"goarm,omitempty" jsonschema:"oneof_type=string;integer"`
Gomips string `yaml:"gomips,omitempty" json:"gomips,omitempty"`
Goppc64 string `yaml:"goppc64,omitempty" json:"goppc64,omitempty"`
Goriscv64 string `yaml:"goriscv64,omitempty" json:"goriscv64,omitempty"`
BuildDetails `yaml:",inline" json:",inline"`
}
type BuildDetails struct {
Buildmode string `yaml:"buildmode,omitempty" json:"buildmode,omitempty" jsonschema:"enum=c-archive,enum=c-shared,enum=pie,enum=,default="`
Ldflags StringArray `yaml:"ldflags,omitempty" json:"ldflags,omitempty"`
Tags FlagArray `yaml:"tags,omitempty" json:"tags,omitempty"`
Flags FlagArray `yaml:"flags,omitempty" json:"flags,omitempty"`
Asmflags StringArray `yaml:"asmflags,omitempty" json:"asmflags,omitempty"`
Gcflags StringArray `yaml:"gcflags,omitempty" json:"gcflags,omitempty"`
Env []string `yaml:"env,omitempty" json:"env,omitempty"`
}
type BuildHookConfig struct {
Pre Hooks `yaml:"pre,omitempty" json:"pre,omitempty"`
Post Hooks `yaml:"post,omitempty" json:"post,omitempty"`
}
type Hooks []Hook
// UnmarshalYAML is a custom unmarshaler that allows simplified declaration of single command.
func (bhc *Hooks) UnmarshalYAML(unmarshal func(interface{}) error) error {
var singleCmd string
err := unmarshal(&singleCmd)
if err == nil {
*bhc = []Hook{{Cmd: singleCmd}}
return nil
}
type t Hooks
var hooks t
if err := unmarshal(&hooks); err != nil {
return err
}
*bhc = (Hooks)(hooks)
return nil
}
type Hook struct {
Dir string `yaml:"dir,omitempty" json:"dir,omitempty"`
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty"`
Env []string `yaml:"env,omitempty" json:"env,omitempty"`
Output bool `yaml:"output,omitempty" json:"output,omitempty"`
}
// UnmarshalYAML is a custom unmarshaler that allows simplified declarations of commands as strings.
func (bh *Hook) UnmarshalYAML(unmarshal func(interface{}) error) error {
var cmd string
if err := unmarshal(&cmd); err != nil {
type t Hook
var hook t
if err := unmarshal(&hook); err != nil {
return err
}
*bh = (Hook)(hook)
return nil
}
bh.Cmd = cmd
return nil
}
// FormatOverride is used to specify a custom format for a specific GOOS.
type FormatOverride struct {
Goos string `yaml:"goos,omitempty" json:"goos,omitempty"`
Format string `yaml:"format,omitempty" json:"format,omitempty" jsonschema:"enum=tar,enum=tgz,enum=tar.gz,enum=zip,enum=gz,enum=tar.xz,enum=txz,enum=binary,enum=none,default=tar.gz"`
}
// File is a file inside an archive.
type File struct {
Source string `yaml:"src,omitempty" json:"src,omitempty"`
Destination string `yaml:"dst,omitempty" json:"dst,omitempty"`
StripParent bool `yaml:"strip_parent,omitempty" json:"strip_parent,omitempty"`
Info FileInfo `yaml:"info,omitempty" json:"info,omitempty"`
Default bool `yaml:"-" json:"-"`
}
// File is a file inside an archive.
type TemplatedFile struct {
Source string `yaml:"src,omitempty" json:"src,omitempty"`
Destination string `yaml:"dst,omitempty" json:"dst,omitempty"`
Info FileInfo `yaml:"info,omitempty" json:"info,omitempty"`
}
// FileInfo is the file info of a file.
type FileInfo struct {
Owner string `yaml:"owner,omitempty" json:"owner,omitempty"`
Group string `yaml:"group,omitempty" json:"group,omitempty"`
Mode os.FileMode `yaml:"mode,omitempty" json:"mode,omitempty"`
MTime string `yaml:"mtime,omitempty" json:"mtime,omitempty"`
ParsedMTime time.Time `yaml:"-" json:"-"`
}
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (f *File) UnmarshalYAML(unmarshal func(interface{}) error) error {
type t File
var str string
if err := unmarshal(&str); err == nil {
*f = File{Source: str}
return nil
}
var file t
if err := unmarshal(&file); err != nil {
return err
}
*f = File(file)
return nil
}
// UniversalBinary setups macos universal binaries.
type UniversalBinary struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
NameTemplate string `yaml:"name_template,omitempty" json:"name_template,omitempty"`
Replace bool `yaml:"replace,omitempty" json:"replace,omitempty"`
Hooks BuildHookConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
ModTimestamp string `yaml:"mod_timestamp,omitempty" json:"mod_timestamp,omitempty"`
}
// ArchiveHooks define actions to run before and/or after something.
type ArchiveHooks struct { // renamed on pro
Before Hooks `yaml:"before,omitempty" json:"before,omitempty"`
After Hooks `yaml:"after,omitempty" json:"after,omitempty"`
}
// UPX allows to compress binaries with `upx`.
type UPX struct {
Enabled string `yaml:"enabled,omitempty" json:"enabled,omitempty" jsonschema:"oneof_type=string;boolean"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Goos []string `yaml:"goos,omitempty" json:"goos,omitempty"`
Goarch []string `yaml:"goarch,omitempty" json:"goarch,omitempty"`
Goarm []string `yaml:"goarm,omitempty" json:"goarm,omitempty"`
Goamd64 []string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"`
Binary string `yaml:"binary,omitempty" json:"binary,omitempty"`
Compress string `yaml:"compress,omitempty" json:"compress,omitempty" jsonschema:"enum=1,enum=2,enum=3,enum=4,enum=5,enum=6,enum=7,enum=8,enum=9,enum=best,enum=,default="`
LZMA bool `yaml:"lzma,omitempty" json:"lzma,omitempty"`
Brute bool `yaml:"brute,omitempty" json:"brute,omitempty"`
}
// Archive config used for the archive.
type Archive struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Builds []string `yaml:"builds,omitempty" json:"builds,omitempty"`
BuildsInfo FileInfo `yaml:"builds_info,omitempty" json:"builds_info,omitempty"`
NameTemplate string `yaml:"name_template,omitempty" json:"name_template,omitempty"`
Format string `yaml:"format,omitempty" json:"format,omitempty" jsonschema:"enum=tar,enum=tgz,enum=tar.gz,enum=zip,enum=gz,enum=tar.xz,enum=txz,enum=binary,default=tar.gz"`
FormatOverrides []FormatOverride `yaml:"format_overrides,omitempty" json:"format_overrides,omitempty"`
WrapInDirectory string `yaml:"wrap_in_directory,omitempty" json:"wrap_in_directory,omitempty" jsonschema:"oneof_type=string;boolean"`
StripBinaryDirectory bool `yaml:"strip_binary_directory,omitempty" json:"strip_binary_directory,omitempty"`
Files []File `yaml:"files,omitempty" json:"files,omitempty"`
Meta bool `yaml:"meta,omitempty" json:"meta,omitempty"`
AllowDifferentBinaryCount bool `yaml:"allow_different_binary_count,omitempty" json:"allow_different_binary_count,omitempty"`
// pro only
Hooks ArchiveHooks `yaml:"hooks,omitempty" json:"hooks,omitempty"`
TemplatedFiles []TemplatedFile `yaml:"templated_files,omitempty" json:"templated_files,omitempty"`
}
type ReleaseNotesMode string
const (
ReleaseNotesModeKeepExisting ReleaseNotesMode = "keep-existing"
ReleaseNotesModeAppend ReleaseNotesMode = "append"
ReleaseNotesModeReplace ReleaseNotesMode = "replace"
ReleaseNotesModePrepend ReleaseNotesMode = "prepend"
)
// Release config used for the GitHub/GitLab release.
type Release struct {
GitHub Repo `yaml:"github,omitempty" json:"github,omitempty"`
GitLab Repo `yaml:"gitlab,omitempty" json:"gitlab,omitempty"`
Gitea Repo `yaml:"gitea,omitempty" json:"gitea,omitempty"`
Draft bool `yaml:"draft,omitempty" json:"draft,omitempty"`
ReplaceExistingDraft bool `yaml:"replace_existing_draft,omitempty" json:"replace_existing_draft,omitempty"`
UseExistingDraft bool `yaml:"use_existing_draft,omitempty" json:"use_existing_draft,omitempty"`
TargetCommitish string `yaml:"target_commitish,omitempty" json:"target_commitish,omitempty"`
Tag string `yaml:"tag,omitempty" json:"tag,omitempty"`
Disable string `yaml:"disable,omitempty" json:"disable,omitempty" jsonschema:"oneof_type=string;boolean"`
SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"`
Prerelease string `yaml:"prerelease,omitempty" json:"prerelease,omitempty"`
MakeLatest string `yaml:"make_latest,omitempty" json:"make_latest,omitempty" jsonschema:"oneof_type=string;boolean"`
NameTemplate string `yaml:"name_template,omitempty" json:"name_template,omitempty"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
ExtraFiles []ExtraFile `yaml:"extra_files,omitempty" json:"extra_files,omitempty"`
DiscussionCategoryName string `yaml:"discussion_category_name,omitempty" json:"discussion_category_name,omitempty"`
ReleaseNotesMode ReleaseNotesMode `yaml:"mode,omitempty" json:"mode,omitempty" jsonschema:"enum=keep-existing,enum=append,enum=prepend,enum=replace,default=keep-existing"`
ReplaceExistingArtifacts bool `yaml:"replace_existing_artifacts,omitempty" json:"replace_existing_artifacts,omitempty"`
IncludeMeta bool `yaml:"include_meta,omitempty" json:"include_meta,omitempty"`
// pro-only
TemplatedExtraFiles []TemplatedExtraFile `yaml:"templated_extra_files,omitempty" json:"templated_extra_files,omitempty"`
Header IncludedMarkdown `yaml:"header,omitempty" json:"header,omitempty"`
Footer IncludedMarkdown `yaml:"footer,omitempty" json:"footer,omitempty"`
}
// Milestone config used for VCS milestone.
type Milestone struct {
Repo Repo `yaml:"repo,omitempty" json:"repo,omitempty"`
Close bool `yaml:"close,omitempty" json:"close,omitempty"`
FailOnError bool `yaml:"fail_on_error,omitempty" json:"fail_on_error,omitempty"`
NameTemplate string `yaml:"name_template,omitempty" json:"name_template,omitempty"`
}
// ExtraFile on a release.
type ExtraFile struct {
Glob string `yaml:"glob,omitempty" json:"glob,omitempty"`
NameTemplate string `yaml:"name_template,omitempty" json:"name_template,omitempty"`
}
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (f *ExtraFile) UnmarshalYAML(unmarshal func(interface{}) error) error {
type t ExtraFile
var str string
if err := unmarshal(&str); err == nil {
*f = ExtraFile{Glob: str}
return nil
}
var file t
if err := unmarshal(&file); err != nil {
return err
}
*f = ExtraFile(file)
return nil
}
// TemplatedExtraFile on a release.
type TemplatedExtraFile struct {
Source string `yaml:"src,omitempty" json:"src,omitempty"`
Destination string `yaml:"dst,omitempty" json:"dst,omitempty"`
}
// NFPM config.
type NFPM struct {
NFPMOverridables `yaml:",inline" json:",inline"`
Overrides map[string]NFPMOverridables `yaml:"overrides,omitempty" json:"overrides,omitempty"`
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Builds []string `yaml:"builds,omitempty" json:"builds,omitempty"`
If string `yaml:"if,omitempty" json:"if,omitempty"`
Formats []string `yaml:"formats,omitempty" json:"formats,omitempty" jsonschema:"enum=apk,enum=deb,enum=rpm,enum=termux.deb,enum=archlinux,enum=ipk"`
Section string `yaml:"section,omitempty" json:"section,omitempty"`
Priority string `yaml:"priority,omitempty" json:"priority,omitempty"`
Vendor string `yaml:"vendor,omitempty" json:"vendor,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
Maintainer string `yaml:"maintainer,omitempty" json:"maintainer,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
Bindir string `yaml:"bindir,omitempty" json:"bindir,omitempty"`
Libdirs Libdirs `yaml:"libdirs,omitempty" json:"libdirs,omitempty"`
Changelog string `yaml:"changelog,omitempty" json:"changelog,omitempty"`
Meta bool `yaml:"meta,omitempty" json:"meta,omitempty"` // make package without binaries - only deps
}
type Libdirs struct {
Header string `yaml:"header,omitempty" json:"header,omitempty"`
CArchive string `yaml:"carchive,omitempty" json:"carchive,omitempty"`
CShared string `yaml:"cshared,omitempty" json:"cshared,omitempty"`
}
// NFPMScripts is used to specify maintainer scripts.
type NFPMScripts struct {
PreInstall string `yaml:"preinstall,omitempty" json:"preinstall,omitempty"`
PostInstall string `yaml:"postinstall,omitempty" json:"postinstall,omitempty"`
PreRemove string `yaml:"preremove,omitempty" json:"preremove,omitempty"`
PostRemove string `yaml:"postremove,omitempty" json:"postremove,omitempty"`
}
type TemplatedNFPMScripts struct {
// Pro only
PreInstall string `yaml:"preinstall,omitempty" json:"preinstall,omitempty"`
PostInstall string `yaml:"postinstall,omitempty" json:"postinstall,omitempty"`
PreRemove string `yaml:"preremove,omitempty" json:"preremove,omitempty"`
PostRemove string `yaml:"postremove,omitempty" json:"postremove,omitempty"`
}
type NFPMRPMSignature struct {
// PGP secret key, can be ASCII-armored
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty"`
KeyPassphrase string `yaml:"-" json:"-"` // populated from environment variable
}
// NFPMRPMScripts represents scripts only available on RPM packages.
type NFPMRPMScripts struct {
PreTrans string `yaml:"pretrans,omitempty" json:"pretrans,omitempty"`
PostTrans string `yaml:"posttrans,omitempty" json:"posttrans,omitempty"`
}
// NFPMRPM is custom configs that are only available on RPM packages.
type NFPMRPM struct {
Summary string `yaml:"summary,omitempty" json:"summary,omitempty"`
Group string `yaml:"group,omitempty" json:"group,omitempty"`
Compression string `yaml:"compression,omitempty" json:"compression,omitempty"`
Signature NFPMRPMSignature `yaml:"signature,omitempty" json:"signature,omitempty"`
Scripts NFPMRPMScripts `yaml:"scripts,omitempty" json:"scripts,omitempty"`
Prefixes []string `yaml:"prefixes,omitempty" json:"prefixes,omitempty"`
Packager string `yaml:"packager,omitempty" json:"packager,omitempty"`
}
// NFPMDebScripts is scripts only available on deb packages.
type NFPMDebScripts struct {
Rules string `yaml:"rules,omitempty" json:"rules,omitempty"`
Templates string `yaml:"templates,omitempty" json:"templates,omitempty"`
}
// NFPMDebTriggers contains triggers only available for deb packages.
// https://wiki.debian.org/DpkgTriggers
// https://man7.org/linux/man-pages/man5/deb-triggers.5.html
type NFPMDebTriggers struct {
Interest []string `yaml:"interest,omitempty" json:"interest,omitempty"`
InterestAwait []string `yaml:"interest_await,omitempty" json:"interest_await,omitempty"`
InterestNoAwait []string `yaml:"interest_noawait,omitempty" json:"interest_noawait,omitempty"`
Activate []string `yaml:"activate,omitempty" json:"activate,omitempty"`
ActivateAwait []string `yaml:"activate_await,omitempty" json:"activate_await,omitempty"`
ActivateNoAwait []string `yaml:"activate_noawait,omitempty" json:"activate_noawait,omitempty"`
}
// NFPMDebSignature contains config for signing deb packages created by nfpm.
type NFPMDebSignature struct {
// PGP secret key, can be ASCII-armored
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty"`
KeyPassphrase string `yaml:"-" json:"-"` // populated from environment variable
// origin, maint or archive (defaults to origin)
Type string `yaml:"type,omitempty" json:"type,omitempty"`
}
// NFPMDeb is custom configs that are only available on deb packages.
type NFPMDeb struct {
Scripts NFPMDebScripts `yaml:"scripts,omitempty" json:"scripts,omitempty"`
Triggers NFPMDebTriggers `yaml:"triggers,omitempty" json:"triggers,omitempty"`
Breaks []string `yaml:"breaks,omitempty" json:"breaks,omitempty"`
Signature NFPMDebSignature `yaml:"signature,omitempty" json:"signature,omitempty"`
Lintian []string `yaml:"lintian_overrides,omitempty" json:"lintian_overrides,omitempty"`
Compression string `yaml:"compression,omitempty" json:"compression,omitempty" jsonschema:"enum=gzip,enum=xz,enum=none,default=gzip"`
Fields map[string]string `yaml:"fields,omitempty" json:"fields,omitempty"`
Predepends []string `yaml:"predepends,omitempty" json:"predepends,omitempty"`
}
type NFPMAPKScripts struct {
PreUpgrade string `yaml:"preupgrade,omitempty" json:"preupgrade,omitempty"`
PostUpgrade string `yaml:"postupgrade,omitempty" json:"postupgrade,omitempty"`
}
// NFPMAPKSignature contains config for signing apk packages created by nfpm.
type NFPMAPKSignature struct {
// RSA private key in PEM format
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty"`
KeyPassphrase string `yaml:"-" json:"-"` // populated from environment variable
// defaults to <maintainer email>.rsa.pub
KeyName string `yaml:"key_name,omitempty" json:"key_name,omitempty"`
}
// NFPMAPK is custom config only available on apk packages.
type NFPMAPK struct {
Scripts NFPMAPKScripts `yaml:"scripts,omitempty" json:"scripts,omitempty"`
Signature NFPMAPKSignature `yaml:"signature,omitempty" json:"signature,omitempty"`
}
type NFPMArchLinuxScripts struct {
PreUpgrade string `yaml:"preupgrade,omitempty" json:"preupgrade,omitempty"`
PostUpgrade string `yaml:"postupgrade,omitempty" json:"postupgrade,omitempty"`
}
type NFPMArchLinux struct {
Pkgbase string `yaml:"pkgbase,omitempty" json:"pkgbase,omitempty"`
Packager string `yaml:"packager,omitempty" json:"packager,omitempty"`
Scripts NFPMArchLinuxScripts `yaml:"scripts,omitempty" json:"scripts,omitempty"`
}
// NFPMIPK is custom config only available on ipk packages.
type NFPMIPKAlternative struct {
Priority int `yaml:"priority,omitempty" json:"priority,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
LinkName string `yaml:"link_name,omitempty" json:"link_name,omitempty"`
}
type NFPMIPK struct {
ABIVersion string `yaml:"abi_version,omitempty" json:"abi_version,omitempty"`
Alternatives []NFPMIPKAlternative `yaml:"alternatives,omitempty" json:"alternatives,omitempty"`
AutoInstalled bool `yaml:"auto_installed,omitempty" json:"auto_installed,omitempty"`
Essential bool `yaml:"essential,omitempty" json:"essential,omitempty"`
Predepends []string `yaml:"predepends,omitempty" json:"predepends,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Fields map[string]string `yaml:"fields,omitempty" json:"fields,omitempty"`
}
// NFPMOverridables is used to specify per package format settings.
type NFPMOverridables struct {
FileNameTemplate string `yaml:"file_name_template,omitempty" json:"file_name_template,omitempty"`
PackageName string `yaml:"package_name,omitempty" json:"package_name,omitempty"`
Epoch string `yaml:"epoch,omitempty" json:"epoch,omitempty"`
Release string `yaml:"release,omitempty" json:"release,omitempty"`
Prerelease string `yaml:"prerelease,omitempty" json:"prerelease,omitempty"`
VersionMetadata string `yaml:"version_metadata,omitempty" json:"version_metadata,omitempty"`
Dependencies []string `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
Recommends []string `yaml:"recommends,omitempty" json:"recommends,omitempty"`
Suggests []string `yaml:"suggests,omitempty" json:"suggests,omitempty"`
Conflicts []string `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
Umask fs.FileMode `yaml:"umask,omitempty" json:"umask,omitempty" jsonschema:"oneof_type=string;integer"`
Replaces []string `yaml:"replaces,omitempty" json:"replaces,omitempty"`
Provides []string `yaml:"provides,omitempty" json:"provides,omitempty"`
Contents NFPMContents `yaml:"contents,omitempty" json:"contents,omitempty"`
Scripts NFPMScripts `yaml:"scripts,omitempty" json:"scripts,omitempty"`
RPM NFPMRPM `yaml:"rpm,omitempty" json:"rpm,omitempty"`
Deb NFPMDeb `yaml:"deb,omitempty" json:"deb,omitempty"`
APK NFPMAPK `yaml:"apk,omitempty" json:"apk,omitempty"`
ArchLinux NFPMArchLinux `yaml:"archlinux,omitempty" json:"archlinux,omitempty"`
IPK NFPMIPK `yaml:"ipk,omitempty" json:"ipk,omitempty"`
// pro onlu
TemplatedContents NFPMContents `yaml:"templated_contents,omitempty" json:"templated_contents,omitempty"`
TemplatedScripts NFPMScripts `yaml:"templated_scripts,omitempty" json:"templated_scripts,omitempty"`
}
// SBOM config.
type SBOM struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty"`
Env []string `yaml:"env,omitempty" json:"env,omitempty"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Documents []string `yaml:"documents,omitempty" json:"documents,omitempty"`
Artifacts string `yaml:"artifacts,omitempty" json:"artifacts,omitempty" jsonschema:"enum=source,enum=package,enum=diskimage,enum=installer,enum=archive,enum=binary,enum=any,default=archive"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
}
// Sign config.
type Sign struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Signature string `yaml:"signature,omitempty" json:"signature,omitempty"`
Artifacts string `yaml:"artifacts,omitempty" json:"artifacts,omitempty" jsonschema:"enum=all,enum=manifests,enum=images,enum=checksum,enum=source,enum=package,enum=archive,enum=binary,enum=sbom,enum=installer,enum=diskimage"`
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
If string `yaml:"if,omitempty" json:"if,omitempty"`
Stdin *string `yaml:"stdin,omitempty" json:"stdin,omitempty"`
StdinFile string `yaml:"stdin_file,omitempty" json:"stdin_file,omitempty"`
Env []string `yaml:"env,omitempty" json:"env,omitempty"`
Certificate string `yaml:"certificate,omitempty" json:"certificate,omitempty"`
Output bool `yaml:"output,omitempty" json:"output,omitempty"`
}
type Notarize struct {
MacOS []MacOSSignNotarize `yaml:"macos" json:"macos"`
}
type MacOSSignNotarize struct {
IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"`
Enabled string `yaml:"enabled,omitempty" json:"enabled,omitempty" jsonschema:"oneof_type=string;boolean"`
Sign MacOSSign `yaml:"sign" json:"sign"`
Notarize MacOSNotarize `yaml:"notarize" json:"notarize"`
}
type MacOSNotarize struct {
IssuerID string `yaml:"issuer_id" json:"issuer_id"`
Key string `yaml:"key" json:"key"`
KeyID string `yaml:"key_id" json:"key_id"`
Timeout time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Wait bool `yaml:"wait,omitempty" json:"wait,omitempty"`
}
type MacOSSign struct {
Certificate string `yaml:"certificate" json:"certificate"`
Password string `yaml:"password" json:"password"`
}