Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
5984d83a46 |
@ -3,8 +3,6 @@ name: goreleaser
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, ci ]
|
branches: [ main, ci ]
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
@ -22,14 +20,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: latest
|
||||||
args: release --clean
|
args: release --nightly
|
||||||
|
env:
|
||||||
env_files:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# override gitea actions which passes GITHUB_TOKEN to set env var as null
|
|
||||||
GITHUB_TOKEN: /dev/null
|
|
||||||
GORELEASER_FORCE_TOKEN: "gitea"
|
|
||||||
GITEA_TOKEN: ${{ secrets.GORELASER_TOKEN }}
|
|
||||||
|
|
||||||
# env:
|
|
||||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
19
.github/workflows/go.yml
vendored
19
.github/workflows/go.yml
vendored
@ -1,19 +0,0 @@
|
|||||||
name: Go
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
|
||||||
go-version: '>=1.20.1'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: go get .
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
- name: Test with the Go CLI
|
|
||||||
run: go test
|
|
@ -22,8 +22,14 @@ type Config struct {
|
|||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "gomailer",
|
Use: "gomailer",
|
||||||
Short: "use it to test email templates",
|
Short: "use it to test email templates",
|
||||||
|
Args: cobra.MinimumNArgs(1),
|
||||||
Long: ``,
|
Long: ``,
|
||||||
// Run: func(cmd *cobra.Command, args []string) { },
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
log.Printf("Templates: %v", args)
|
||||||
|
for _, arg := range args {
|
||||||
|
gomailer.Inline(arg)
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
@ -36,6 +42,7 @@ func Execute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
cobra.MousetrapHelpText = "" // disable warning on windows for drag n drop to exe
|
||||||
cobra.OnInitialize(initConfig)
|
cobra.OnInitialize(initConfig)
|
||||||
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
||||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gomailer.yaml)")
|
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gomailer.yaml)")
|
||||||
|
Loading…
Reference in New Issue
Block a user