Skip to content

Commit

Permalink
Merge pull request #25 from jplanckeel/ci/add-goreleaser
Browse files Browse the repository at this point in the history
ci: add go-releaser
  • Loading branch information
jplanckeel authored Mar 8, 2024
2 parents fa80b3d + 95a8c9d commit ebc6c10
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
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")
}

0 comments on commit ebc6c10

Please sign in to comment.