Skip to content

Update GoReleaser and sign artifacts #359

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

Merged
merged 1 commit into from
Aug 4, 2023
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
needs: [binary, unit-tests]
permissions:
contents: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
Expand Down Expand Up @@ -94,12 +95,18 @@ jobs:

- name: Download Syft
uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
if: github.ref_type == 'tag'

- name: Install Cosign
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1
if: github.ref_type == 'tag'

- name: Build binaries
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
version: latest
args: release ${{ github.ref_type == 'tag' && '' || '--snapshot' }} --clean
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ steps.go.outputs.go_path }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
53 changes: 40 additions & 13 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ builds:
- 386
- amd64
- arm64
- ppc64le
- s390x
flags:
- -trimpath
Expand All @@ -23,19 +24,6 @@ builds:
main: ./cmd/sync
binary: nginx-asg-sync

archives:
- files:
- README.md
- LICENSE
- CHANGELOG.md
- build/config.yaml.example

sboms:
- artifacts: archive

changelog:
skip: true

nfpms:
- file_name_template: "{{ .ConventionalFileName }}"
vendor: NGINX Inc.
Expand Down Expand Up @@ -89,3 +77,42 @@ nfpms:
postinstall: "build/postinstall.sh"
preremove: "build/preremove.sh"
postremove: "build/postremove.sh"

changelog:
skip: true

archives:
- files:
- README.md
- LICENSE
- CHANGELOG.md
- build/config.yaml.example

sboms:
- artifacts: archive
documents:
- "${artifact}.spdx.json"

signs:
- cmd: cosign
artifacts: checksum
output: true
certificate: '${artifact}.pem'
args:
- sign-blob
- "--output-signature=${signature}"
- "--output-certificate=${certificate}"
- "${artifact}"
- "--yes"

announce:
slack:
enabled: true
channel: '#announcements'
message_template: 'NGINX Plus Integration with Cloud Autoscaling {{ .Tag }} is out! Check it out: {{ .ReleaseURL }}'

milestones:
- close: true

snapshot:
name_template: 'edge'
6 changes: 3 additions & 3 deletions LICENSES
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Azure/azure-sdk-for-go,https://github.com/Azure/azure-sdk-for-go/blob/v66.0.0/LICENSE.txt,MIT
github.com/Azure/azure-sdk-for-go,https://github.com/Azure/azure-sdk-for-go/blob/v68.0.0/LICENSE.txt,MIT
github.com/Azure/go-autorest/autorest,https://github.com/Azure/go-autorest/blob/autorest/v0.11.24/autorest/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/adal,https://github.com/Azure/go-autorest/blob/autorest/adal/v0.9.18/autorest/adal/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/azure/auth,https://github.com/Azure/go-autorest/blob/autorest/azure/auth/v0.5.11/autorest/azure/auth/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/azure/auth,https://github.com/Azure/go-autorest/blob/autorest/azure/auth/v0.5.12/autorest/azure/auth/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/azure/cli,https://github.com/Azure/go-autorest/blob/autorest/azure/cli/v0.4.5/autorest/azure/cli/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/date,https://github.com/Azure/go-autorest/blob/autorest/date/v0.3.0/autorest/date/LICENSE,Apache-2.0
github.com/Azure/go-autorest/autorest/to,https://github.com/Azure/go-autorest/blob/autorest/to/v0.4.0/autorest/to/LICENSE,Apache-2.0
Expand All @@ -16,5 +16,5 @@ github.com/jmespath/go-jmespath,https://github.com/jmespath/go-jmespath/blob/v0.
github.com/mitchellh/go-homedir,https://github.com/mitchellh/go-homedir/blob/v1.1.0/LICENSE,MIT
github.com/nginxinc/nginx-asg-sync/cmd/sync,https://github.com/nginxinc/nginx-asg-sync/blob/HEAD/LICENSE,BSD-2-Clause
github.com/nginxinc/nginx-plus-go-client/client,https://github.com/nginxinc/nginx-plus-go-client/blob/v0.10.0/LICENSE,Apache-2.0
golang.org/x/crypto/pkcs12,https://cs.opensource.google/go/x/crypto/+/e495a2d5:LICENSE,BSD-3-Clause
golang.org/x/crypto/pkcs12,https://cs.opensource.google/go/x/crypto/+/v0.1.0:LICENSE,BSD-3-Clause
gopkg.in/yaml.v2,https://github.com/go-yaml/yaml/blob/v2.4.0/LICENSE,Apache-2.0
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ nginx-asg-sync:
.PHONY: build-goreleaser
build-goreleaser:
@goreleaser -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with GoReleaser. Follow the docs to install it https://goreleaser.com/install\n"; exit $$code)
@GOPATH=$(shell go env GOPATH) goreleaser release --rm-dist --snapshot
@GOPATH=$(shell go env GOPATH) goreleaser release --clean --snapshot

.PHONY: build-goreleaser-docker
build-goreleaser-docker:
@docker -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with Docker\n"; exit $$code)
@docker run --rm --privileged -v $(PWD):/go/src/github.com/nginxinc/nginx-asg-sync -v /var/run/docker.sock:/var/run/docker.sock -w /go/src/github.com/nginxinc/nginx-asg-sync goreleaser/goreleaser release --snapshot --rm-dist
@docker run --rm --privileged -v $(PWD):/go/src/github.com/nginxinc/nginx-asg-sync -v /var/run/docker.sock:/var/run/docker.sock -w /go/src/github.com/nginxinc/nginx-asg-sync goreleaser/goreleaser release --snapshot --clean

.PHONY: clean
clean:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Below you will find documentation on how to use nginx-asg-sync.

## Supported Operating Systems and Architectures

We provide `.rpm` and `.deb` packages for `386`, `amd64`, `arm64`, and `s390x`.
We provide `.rpm` and `.deb` packages for `386`, `amd64`, `arm64`, `ppc64le` and `s390x`.

Support for other operating systems or architectures can be added.

Expand All @@ -70,8 +70,8 @@ Support for other operating systems or architectures can be added.
- For the latest source code from the main branch, build a software package by following [these
instructions](#building-a-software-package).
2. Install the package:
- For CentOS/RHEL based OSs, run: `$ sudo rpm -i <package-name>.rpm`
- For Debian based OSs, run: `$ sudo dpkg -i <package-name>.deb`
- For CentOS/RHEL based OSs, run: `sudo rpm -i <package-name>.rpm`
- For Debian based OSs, run: `sudo dpkg -i <package-name>.deb`

### NGINX Plus Configuration

Expand Down