Coder Social home page Coder Social logo

Comments (3)

caarlos0 avatar caarlos0 commented on June 1, 2024 1

all that being said, I don't think we need to hard-integrate goreleaser with go-licenses... it's already possible to use it.

thanks for the issue, though!

from goreleaser.

caarlos0 avatar caarlos0 commented on June 1, 2024

you could run it in a before hook, and then archive the folder to add to the release...

e.g.:

# .goreleaser.yml
before:
  hooks:
    - go run github.com/google/go-licenses@latest save . --save_path="licenses"

archives:
  - id: default
    # ...
    files:
      # add to the default release archives
      - ./licenses
  # create an archive with licenses only
  - id: licenses
    name_template: licenses
    format: tar.gz
    meta: true
    files:
      - ./licenses

this should add a licenses.tar.gz to the release artifacts...

if you want to add to the regular release archive, just add the ./dist/licenses to its files section...

you might need to add the licenses folder to the gitignore though

from goreleaser.

caarlos0 avatar caarlos0 commented on June 1, 2024

just tried it here, fwiw:

patch on goreleaser's own .goreleaser.yml
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index 6559a447..ecb542e5 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -10,6 +10,7 @@ before:
     - go mod tidy
     - ./scripts/completions.sh
     - ./scripts/manpages.sh
+    - go run github.com/google/go-licenses@latest save . --save_path="licenses"
 
 snapshot:
   name_template: "{{ incpatch .Version }}-next"
@@ -182,6 +183,13 @@ archives:
       - LICENSE.md
       - completions/*
       - manpages/*
+      - licenses
+  - id: licenses
+    name_template: licenses
+    format: tar.gz
+    meta: true
+    files:
+      - licenses
 
 brews:
   - repository:
files after running goreleaser release --snapshot --clean
$ ls -1 dist/*.tar.gz
dist/goreleaser_Darwin_all.tar.gz
dist/goreleaser_Darwin_arm64.tar.gz
dist/goreleaser_Darwin_x86_64.tar.gz
dist/goreleaser_Linux_arm64.tar.gz
dist/goreleaser_Linux_armv7.tar.gz
dist/goreleaser_Linux_i386.tar.gz
dist/goreleaser_Linux_ppc64.tar.gz
dist/goreleaser_Linux_x86_64.tar.gz
dist/licenses.tar.gz

$ tar tvf dist/goreleaser_Linux_i386.tar.gz | grep licenses | wc -l
1375

from goreleaser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.