mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
feat: update nfpm to 2.9.2 (#2668)
* feat: update nfpm to 2.9.2 * chore(ci): test packages on main
This commit is contained in:
parent
f731173491
commit
c631b910ee
96
.github/workflows/build.yml
vendored
96
.github/workflows/build.yml
vendored
@ -9,97 +9,99 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
goreleaser-check-pkgs:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
needs:
|
||||
- goreleaser
|
||||
if: github.ref == 'refs/heads/main'
|
||||
strategy:
|
||||
matrix:
|
||||
format: [ deb, rpm, apk ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 3.x
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ./dist
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
|
||||
- run: task goreleaser:test:${{ matrix.format }}
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Task
|
||||
uses: arduino/setup-task@v1
|
||||
- uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 3.x
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
-
|
||||
name: Set up Pack CLI for Buildpacks
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- name: setup-buildpacks
|
||||
run: |
|
||||
sudo add-apt-repository ppa:cncf-buildpacks/pack-cli
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-suggests --no-install-recommends install pack-cli
|
||||
-
|
||||
name: Set up Snapcraft
|
||||
- name: setup-snapcraft
|
||||
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
|
||||
mkdir -p $HOME/.cache/snapcraft/download
|
||||
mkdir -p $HOME/.cache/snapcraft/stage-packages
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.17'
|
||||
-
|
||||
name: Cache Go mod and build
|
||||
uses: actions/cache@v2
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/.cache/go-build
|
||||
./dist
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
-
|
||||
name: Setup Sigstore
|
||||
uses: sigstore/cosign-installer@v1.3.1
|
||||
- # TODO: replace this once https://github.com/kubernetes-sigs/krew/pull/736 is merged
|
||||
name: Install validate-krew-manifest
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ./dist
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
|
||||
- uses: sigstore/cosign-installer@v1.3.1
|
||||
- name: setup-validate-krew-manifest
|
||||
# TODO: replace this once https://github.com/kubernetes-sigs/krew/pull/736 is merged
|
||||
run: go install github.com/caarlos0/krew/cmd/validate-krew-manifest@fork
|
||||
-
|
||||
name: build and test
|
||||
run: task ci
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
- run: task ci
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
file: ./coverage.txt
|
||||
-
|
||||
name: Check
|
||||
run: ./goreleaser check
|
||||
-
|
||||
name: Diff
|
||||
run: git diff
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
- run: ./goreleaser check
|
||||
- run: git diff
|
||||
- name: dockerhub-login
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Login to GitHub Container Registry
|
||||
- name: ghcr-login
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Snapcraft Login
|
||||
- name: snapcraft-login
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
|
||||
-
|
||||
name: GoReleaser
|
||||
- name: goreleaser-release
|
||||
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
|
2
go.mod
2
go.mod
@ -18,7 +18,7 @@ require (
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
|
||||
github.com/google/go-github/v39 v39.2.0
|
||||
github.com/goreleaser/fileglob v1.2.0
|
||||
github.com/goreleaser/nfpm/v2 v2.9.1
|
||||
github.com/goreleaser/nfpm/v2 v2.9.2
|
||||
github.com/imdario/mergo v0.3.12
|
||||
github.com/jarcoal/httpmock v1.0.8
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
|
4
go.sum
4
go.sum
@ -427,8 +427,8 @@ github.com/goreleaser/chglog v0.1.2 h1:tdzAb/ILeMnphzI9zQ7Nkq+T8R9qyXli8GydD8plF
|
||||
github.com/goreleaser/chglog v0.1.2/go.mod h1:tTZsFuSZK4epDXfjMkxzcGbrIOXprf0JFp47BjIr3B8=
|
||||
github.com/goreleaser/fileglob v1.2.0 h1:OErqbdzeg/eibfDGPHDQDN8jL5u1jNyxA5IQzNPLLoU=
|
||||
github.com/goreleaser/fileglob v1.2.0/go.mod h1:rFyb2pXaK3YdnYnSjn6lifw0h2Q6s8OfOsx6I6bXkKE=
|
||||
github.com/goreleaser/nfpm/v2 v2.9.1 h1:1TCWqgiimrqqvqXxqG+7m+BuJaWV2HDx8uXgLbO/K5c=
|
||||
github.com/goreleaser/nfpm/v2 v2.9.1/go.mod h1:Bj/ztLvdnBnEgMae0fl/bLF6By1+yFFKeL97WiS6ZJg=
|
||||
github.com/goreleaser/nfpm/v2 v2.9.2 h1:L6CnpgugnSXFuC2eYvfDiYsb6Kb4o2g9rIBxJL31hpc=
|
||||
github.com/goreleaser/nfpm/v2 v2.9.2/go.mod h1:Bj/ztLvdnBnEgMae0fl/bLF6By1+yFFKeL97WiS6ZJg=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
|
@ -595,7 +595,7 @@ type NFPMOverridables struct {
|
||||
Suggests []string `yaml:"suggests,omitempty"`
|
||||
Conflicts []string `yaml:"conflicts,omitempty"`
|
||||
Replaces []string `yaml:"replaces,omitempty"`
|
||||
EmptyFolders []string `yaml:"empty_folders,omitempty"`
|
||||
EmptyFolders []string `yaml:"empty_folders,omitempty"` // deprecated
|
||||
Contents files.Contents `yaml:"contents,omitempty"`
|
||||
Scripts NFPMScripts `yaml:"scripts,omitempty"`
|
||||
RPM NFPMRPM `yaml:"rpm,omitempty"`
|
||||
|
@ -120,12 +120,6 @@ nfpms:
|
||||
# Defaults to false.
|
||||
meta: true
|
||||
|
||||
# Empty folders that should be created and managed by the packager
|
||||
# implementation.
|
||||
# Default is empty.
|
||||
empty_folders:
|
||||
- /var/log/foobar
|
||||
|
||||
# Contents to add to the package.
|
||||
# GoReleaser will automatically add the binaries.
|
||||
contents:
|
||||
@ -228,8 +222,6 @@ nfpms:
|
||||
- tig
|
||||
replaces:
|
||||
- bash
|
||||
empty_folders:
|
||||
- /var/log/bar
|
||||
rpm:
|
||||
replacements:
|
||||
amd64: x86_64
|
||||
|
@ -36,6 +36,28 @@ Description.
|
||||
|
||||
-->
|
||||
|
||||
### nfpm.empty_folders
|
||||
|
||||
> since 2021-11-14 (v1.0.0)
|
||||
|
||||
nFPM empty folders is now deprecated in favor of a `dir` content type:
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
nfpms:
|
||||
- empty_folders:
|
||||
- /foo/bar
|
||||
```
|
||||
|
||||
=== "After"
|
||||
``` yaml
|
||||
nfpms:
|
||||
- contents:
|
||||
- dst: /foo/bar
|
||||
type: dir
|
||||
```
|
||||
|
||||
### godownloader
|
||||
|
||||
> since 2021-10-13
|
||||
|
Loading…
x
Reference in New Issue
Block a user