Skip to content
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

Restore binary upload #2543

Merged
merged 2 commits into from Mar 28, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 15 additions & 17 deletions .github/workflows/ci.yml
Expand Up @@ -107,10 +107,12 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --snapshot --rm-dist --id kubernetes-ingress --single-target
args: build --snapshot --rm-dist --single-target
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ needs.check.outputs.go_path }}
GOPATH: ${{ needs.checks.outputs.go_path }}
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
- name: Store Artifacts in Cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -277,14 +279,23 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ needs.checks.outputs.go_version }}
- name: Publish Release Notes on new tag
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build binaries
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --rm-dist --id kubernetes-ingress ${{ github.event_name == 'pull_request' && '--single-target' || '' }} ${{ !startsWith(github.ref, 'refs/tags/') && '--snapshot' || '' }}
args: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ needs.check.outputs.go_path }}
GOPATH: ${{ needs.checks.outputs.go_path }}
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
- name: Store Artifacts in Cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -600,16 +611,3 @@ jobs:
git -c user.name='${{ env.GIT_NAME }}' -c user.email='${{ env.GIT_MAIL }}' \
commit -m "NGINX Ingress Controller - Release ${{ needs.package-helm.outputs.type }} ${{ needs.package-helm.outputs.version }}"
git push -u origin master

publish-release-notes:
name: Publish Release Notes
runs-on: ubuntu-20.04
needs: release-helm
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Publish Release Notes
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 10 additions & 2 deletions .goreleaser.yml
Expand Up @@ -25,19 +25,27 @@ builds:
- linux
goarch:
- amd64
- arm64
flags:
- -trimpath
gcflags:
- all=-trimpath={{.Env.GOPATH}}
asmflags:
- all=-trimpath={{.Env.GOPATH}}
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.productCode={{.Env.PRODUCT_CODE}} -X main.pubKeyString={{.Env.PUB_KEY}}
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.productCode={{.Env.AWS_PRODUCT_CODE}} -X main.pubKeyString={{.Env.AWS_PUB_KEY}}
main: ./cmd/nginx-ingress/
binary: nginx-ingress
tags:
- aws
archives:
- format: binary
- id: kubernetes-ingress
format: binary
builds: [kubernetes-ingress]
- id: aws
format: binary
builds: [aws]
changelog:
skip: true
release:
ids: [kubernetes-ingress]