Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add go-releaser #25

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ jobs:
push: true
tags: jplanckeel/scope:${{steps.version_tag.outputs.tag}},jplanckeel/scope:latest

- name: Run GoReleaser
if: "steps.tag.outputs.value != ''"
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean

release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
Expand Down
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPRIVATE=github.com/jplanckeel
goos:
- linux
goarch:
- amd64
- arm64
id: "scope-linux"
binary: "{{ .ProjectName }}.plugin"

- env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPRIVATE=github.com/jplanckeel
goos:
- darwin
goarch:
- amd64
- arm64
id: "scope-darwin"
binary: "{{ .ProjectName }}.plugin"
flags:
- -tags=netgo

archives:
- format: gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ prometheus-community.github.io/helm-charts:

```

## Docker Image

You can find a docker image with Helm and Scope cli here :

https://hub.docker.com/r/jplanckeel/scope

```bash
docker run jplanckeel/scope scope -h
```

## CI

### Gitlab-ci
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var config internal.ScopeConfig

var rootCmd = &cobra.Command{
Version: "0.2.0",
Version: "0.3.0",
Use: "scope",
Short: "a cli to sync helmchart to private registry",
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -30,7 +30,7 @@ func init() {
rootCmd.PersistentFlags().BoolVarP(&config.Dryrun, "dryrun", "d", false, "enable dry-run mode")
rootCmd.PersistentFlags().StringVarP(&config.ConfigFile, "config", "c", "", "path to configfile")
rootCmd.PersistentFlags().StringVarP(&config.Registry, "registry", "r", "", "destination chart registry")
rootCmd.PersistentFlags().StringVarP(&config.RegistryType, "registry-type", "t", "oci", "registry nexus or ecr (default: oci)")
rootCmd.PersistentFlags().StringVarP(&config.RegistryType, "registry-type", "t", "oci", "registry nexus or oci")
rootCmd.PersistentFlags().StringVarP(&config.User, "user", "u", "", "user for nexus registry")
rootCmd.PersistentFlags().StringVarP(&config.Password, "password", "p", "", "password for nexus registry")
}