go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/.github/.goreleaser-unstable.yml (about)

     1  # Copyright (c) Mondoo, Inc.
     2  # SPDX-License-Identifier: BUSL-1.1
     3  
     4  ---
     5  project_name: cnquery
     6  env:
     7    - CGO_ENABLED=0
     8  before:
     9    hooks:
    10      - make providers
    11  builds:
    12    - id: linux
    13      main: ./apps/cnquery/cnquery.go
    14      binary: cnquery
    15      goos:
    16        - linux
    17      goarch:
    18        - amd64
    19        - 386
    20        - arm64
    21        - arm
    22        - ppc64le
    23      # ARM 6= Raspberry Pi A, A+, B, B+, Zero
    24      # ARM 7= Raspberry Pi 2, 3, 4
    25      goarm:
    26        - 6
    27        - 7
    28      flags:
    29        - -tags="production netgo"
    30      ldflags:
    31        - "-extldflags=-static"
    32        - -s -w -X go.mondoo.com/cnquery.Version={{.Version}} -X go.mondoo.com/cnquery.Build={{.ShortCommit}} -X go.mondoo.com/cnquery.Date={{.Date}}
    33    - id: macos
    34      main: ./apps/cnquery/cnquery.go
    35      binary: cnquery
    36      goos:
    37        - darwin
    38      goarch:
    39        - amd64
    40        - arm64
    41      flags: -tags production
    42      ldflags:
    43        # clang + macos does not support static: - -extldflags "-static"
    44        - -s -w -X go.mondoo.com/cnquery.Version={{.Version}} -X go.mondoo.com/cnquery.Build={{.ShortCommit}} -X go.mondoo.com/cnquery.Date={{.Date}}
    45      hooks:
    46        post:
    47          - cmd: /tmp/quill sign-and-notarize "{{ .Path }}" -vv || true
    48            env:
    49              - QUILL_LOG_FILE=/tmp/quill-{{ .Target }}.log
    50    - id: windows
    51      main: ./apps/cnquery/cnquery.go
    52      binary: cnquery
    53      goos:
    54        - windows
    55      goarch:
    56        - amd64
    57        - arm64
    58      # -buildmode exe is required since go 1.15.0 https://github.com/golang/go/issues/40795
    59      flags: -tags production -buildmode exe
    60      ldflags:
    61        - "-extldflags -static"
    62        - -s -w -X go.mondoo.com/cnquery.Version={{.Version}} -X go.mondoo.com/cnquery.Build={{.ShortCommit}} -X go.mondoo.com/cnquery.Date={{.Date}}
    63      hooks:
    64        post:
    65          - cmd: ./scripts/windows-upx.sh "{{ .Path }}"
    66            output: true
    67            env:
    68            - TARGET={{ .Target }}
    69          - cmd: jsign --storetype DIGICERTONE --alias "{{ .Env.SM_CERT_ALIAS }}" --storepass "{{ .Env.SM_API_KEY }}|{{ .Env.SM_CLIENT_CERT_FILE}}|{{ .Env.SM_CLIENT_CERT_PASSWORD }}" --tsaurl "http://timestamp.digicert.com" '{{ .Path }}'
    70  nfpms:
    71    -
    72      maintainer: Mondoo <hello@mondoo.com>
    73      description: Cloud-Native Asset Inventory Framework
    74      homepage: https://mondoo.com/
    75      vendor: Mondoo, Inc
    76      license: MPL-2.0
    77      formats:
    78        - deb
    79        - rpm
    80      rpm:
    81        signature:
    82          key_file: '{{ .Env.GPG_KEY_PATH }}'
    83  archives:
    84    - id: releases
    85      format_overrides:
    86        - goos: windows
    87          format: zip
    88      files:
    89        - none*
    90  checksum:
    91    name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
    92    algorithm: sha256
    93  snapshot:
    94    name_template: "{{ .Tag }}-snapshot"
    95  changelog:
    96    use: github-native
    97  dockers: # https://goreleaser.com/customization/docker/
    98      # UBI containers
    99    - use: buildx
   100      goos: linux
   101      goarch: amd64
   102      dockerfile: Dockerfile-ubi
   103      image_templates:
   104        - "mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-amd64"
   105      build_flag_templates:
   106        - "--platform=linux/amd64"
   107        - "--label=org.opencontainers.image.created={{.Date}}"
   108        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   109        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   110        - "--label=org.opencontainers.image.version={{.Version}}"
   111        - "--target=root"
   112    - use: buildx
   113      goos: linux
   114      goarch: arm64
   115      dockerfile: Dockerfile-ubi
   116      image_templates:
   117        - "mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-arm64"
   118      build_flag_templates:
   119        - "--platform=linux/arm64"
   120        - "--label=org.opencontainers.image.created={{.Date}}"
   121        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   122        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   123        - "--label=org.opencontainers.image.version={{.Version}}"
   124        - "--target=root"
   125      # Standard containers
   126    - use: buildx
   127      goos: linux
   128      goarch: amd64
   129      image_templates:
   130        - "mondoo/{{ .ProjectName }}:{{ .Version }}-amd64"
   131      build_flag_templates:
   132        - "--platform=linux/amd64"
   133        - "--label=org.opencontainers.image.created={{.Date}}"
   134        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   135        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   136        - "--label=org.opencontainers.image.version={{.Version}}"
   137        - "--target=root"
   138    - use: buildx
   139      goos: linux
   140      goarch: arm64
   141      image_templates:
   142        - "mondoo/{{ .ProjectName }}:{{ .Version }}-arm64v8"
   143      build_flag_templates:
   144        - "--platform=linux/arm64/v8"
   145        - "--label=org.opencontainers.image.created={{.Date}}"
   146        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   147        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   148        - "--label=org.opencontainers.image.version={{.Version}}"
   149        - "--target=root"
   150    - use: buildx
   151      goos: linux
   152      goarch: arm
   153      goarm: 6
   154      image_templates:
   155        - "mondoo/{{ .ProjectName }}:{{ .Version }}-armv6"
   156      build_flag_templates:
   157        - "--platform=linux/arm/v6"
   158        - "--label=org.opencontainers.image.created={{.Date}}"
   159        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   160        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   161        - "--label=org.opencontainers.image.version={{.Version}}"
   162        - "--target=root"
   163    - use: buildx
   164      goos: linux
   165      goarch: arm
   166      goarm: 7
   167      image_templates:
   168        - "mondoo/{{ .ProjectName }}:{{ .Version }}-armv7"
   169      build_flag_templates:
   170        - "--platform=linux/arm/v7"
   171        - "--label=org.opencontainers.image.created={{.Date}}"
   172        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   173        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   174        - "--label=org.opencontainers.image.version={{.Version}}"
   175        - "--target=root"
   176    # Rootless
   177      # UBI containers
   178    - use: buildx
   179      goos: linux
   180      goarch: amd64
   181      dockerfile: Dockerfile-ubi
   182      image_templates:
   183        - "mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-amd64-rootless"
   184      build_flag_templates:
   185        - "--platform=linux/amd64"
   186        - "--label=org.opencontainers.image.created={{.Date}}"
   187        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   188        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   189        - "--label=org.opencontainers.image.version={{.Version}}"
   190        - "--target=rootless"
   191    - use: buildx
   192      goos: linux
   193      goarch: arm64
   194      dockerfile: Dockerfile-ubi
   195      image_templates:
   196        - "mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-arm64-rootless"
   197      build_flag_templates:
   198        - "--platform=linux/arm64/v8"
   199        - "--label=org.opencontainers.image.created={{.Date}}"
   200        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   201        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   202        - "--label=org.opencontainers.image.version={{.Version}}"
   203        - "--target=rootless"
   204      # Standard containers
   205    - use: buildx
   206      goos: linux
   207      goarch: amd64
   208      image_templates:
   209        - "mondoo/{{ .ProjectName }}:{{ .Version }}-amd64-rootless"
   210      build_flag_templates:
   211        - "--platform=linux/amd64"
   212        - "--label=org.opencontainers.image.created={{.Date}}"
   213        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   214        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   215        - "--label=org.opencontainers.image.version={{.Version}}"
   216        - "--target=rootless"
   217    - use: buildx
   218      goos: linux
   219      goarch: arm64
   220      image_templates:
   221        - "mondoo/{{ .ProjectName }}:{{ .Version }}-arm64v8-rootless"
   222      build_flag_templates:
   223        - "--platform=linux/arm64/v8"
   224        - "--label=org.opencontainers.image.created={{.Date}}"
   225        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   226        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   227        - "--label=org.opencontainers.image.version={{.Version}}"
   228        - "--target=rootless"
   229    - use: buildx
   230      goos: linux
   231      goarch: arm
   232      goarm: 6
   233      image_templates:
   234        - "mondoo/{{ .ProjectName }}:{{ .Version }}-armv6-rootless"
   235      build_flag_templates:
   236        - "--platform=linux/arm/v6"
   237        - "--label=org.opencontainers.image.created={{.Date}}"
   238        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   239        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   240        - "--label=org.opencontainers.image.version={{.Version}}"
   241        - "--target=rootless"
   242    - use: buildx
   243      goos: linux
   244      goarch: arm
   245      goarm: 7
   246      image_templates:
   247        - "mondoo/{{ .ProjectName }}:{{ .Version }}-armv7-rootless"
   248      build_flag_templates:
   249        - "--platform=linux/arm/v7"
   250        - "--label=org.opencontainers.image.created={{.Date}}"
   251        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   252        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   253        - "--label=org.opencontainers.image.version={{.Version}}"
   254        - "--target=rootless"
   255  docker_manifests:  # https://goreleaser.com/customization/docker_manifest/
   256      # UBI containers
   257    - name_template: mondoo/{{ .ProjectName }}:{{ .Version }}-ubi
   258      image_templates:
   259        - mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-amd64
   260        - mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-arm64
   261      # Standard containers
   262    - name_template: mondoo/{{ .ProjectName }}:{{ .Version }}
   263      image_templates:
   264        - mondoo/{{ .ProjectName }}:{{ .Version }}-amd64
   265        - mondoo/{{ .ProjectName }}:{{ .Version }}-arm64v8
   266        - mondoo/{{ .ProjectName }}:{{ .Version }}-armv6
   267        - mondoo/{{ .ProjectName }}:{{ .Version }}-armv7
   268    # Rootless
   269      # UBI containers
   270    - name_template: mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-rootless
   271      image_templates:
   272        - mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-amd64-rootless
   273        - mondoo/{{ .ProjectName }}:{{ .Version }}-ubi-arm64-rootless
   274      # Standard containers
   275    - name_template: mondoo/{{ .ProjectName }}:{{ .Version }}-rootless
   276      image_templates:
   277        - mondoo/{{ .ProjectName }}:{{ .Version }}-amd64-rootless
   278        - mondoo/{{ .ProjectName }}:{{ .Version }}-arm64v8-rootless
   279        - mondoo/{{ .ProjectName }}:{{ .Version }}-armv6-rootless
   280        - mondoo/{{ .ProjectName }}:{{ .Version }}-armv7-rootless