Skip to content

Commit

Permalink
add goreleaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshal Ranjhani authored and Harshal Ranjhani committed May 25, 2024
1 parent 481985d commit 8f91304
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 131 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: GoReleaser

on:
repository_dispatch:
types: [trigger-workflow-event]
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: 'latest'
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136 changes: 5 additions & 131 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,135 +46,9 @@ changelog:
- Merge pull request
- Merge branch

# .goreleaser.yaml
brews:
-
name: genie

# NOTE: make sure the url_template, the token and given repo (github or
# gitlab) owner and name are from the same kind.
# We will probably unify this in the next major version like it is
# done with scoop.

# URL which is determined by the given Token (github, gitlab or gitea).
#
# Default depends on the client.
# Templates: allowed
url_template: "https://github.mycompany.com/foo/bar/releases/download/{{ .Tag }}/{{ .ArtifactName }}"



# Git author used to commit to the repository.
commit_author:
name: harshalranjhani
email: mail@harshalranjhani.in

# The project name and current git tag are used in the format string.
#
# Templates: allowed
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"

# Caveats for the user of your binary.
caveats: "How to use this binary"

# Your app's homepage.
homepage: "https://harshalranjhani.in/"

# Your app's description.
#
# Templates: allowed
description: "An AI powered CLI tool written in Golang. Currently supports command execution from simple text, text generation, music generation, image generation and much more."

# SPDX identifier of your app's license.
license: "MIT"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist directory
# only, leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
#
# Templates: allowed
skip_upload: true



# So you can `brew test` your formula.
#
# Template: allowed
test: |
system "#{bin}/foo --version"
# ...
# Repository to push the generated files to.
repository:
# Repository owner.
#
# Templates: allowed
owner: harshalranjhani

# Repository name.
#
# Templates: allowed
name: genie

# Optionally a branch can be provided.
#
# Default: default repository branch
# Templates: allowed
branch: main

# Optionally a token can be provided, if it differs from the token
# provided to GoReleaser
#
# Templates: allowed
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"

# Sets up pull request creation instead of just pushing to the given branch.
# Make sure the 'branch' property is different from base before enabling
# it.
#
# Since: v1.17
pull_request:
# Whether to enable it or not.
enabled: true

# Base can also be another repository, in which case the owner and name
# above will be used as HEAD, allowing cross-repository pull requests.
#
# Since: v1.19
base:
owner: goreleaser
name: my-repo
branch: main

# Clone, create the file, commit and push, to a regular Git repository.
#
# Notice that this will only have any effect if the given URL is not
# empty.
#
# Since: v1.18
git:
# The Git URL to push.
#
# Templates: allowed
url: 'ssh://git@myserver.com:repo.git'

# The SSH private key that should be used to commit to the Git
# repository.
# This can either be a path or the key contents.
#
# IMPORTANT: the key must not be password-protected.
#
# WARNING: do not expose your private key in the configuration file!
#
# Templates: allowed
private_key: '{{ .Env.PRIVATE_KEY_PATH }}'

# The value to be passed to `GIT_SSH_COMMAND`.
# This is mainly used to specify the SSH private key used to pull/push
# to the Git URL.
#
# Default: 'ssh -i {{ .KeyPath }} -o StrictHostKeyChecking=accept-new -F /dev/null'
# Templates: allowed
ssh_command: 'ssh -i {{ .Env.KEY }} -o SomeOption=yes'
- name: genie
homepage: https://genie.harshalranjhani.in
tap:
owner: harshalranjhani
name: homebrew-genie

0 comments on commit 8f91304

Please sign in to comment.