Skip to content

Commit

Permalink
try using github.event.repository.default_branch context
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Feb 10, 2024
1 parent d1bcd86 commit 94a3457
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 1 addition & 6 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ runs:
shell: bash
run: |
echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin
- name: Check if default branch
uses: launchdarkly/gh-actions/actions/default-branch@ead22860bb097df32a9a1a2d06066922b00b86ca
id: default-branch
with:
token: ${{ inputs.token }}
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }}
env:
GITHUB_TOKEN: ${{ inputs.token }}
DEFAULT_BRANCH: ${{ steps.default-branch.outputs.value }}
NOT_DEFAULT_BRANCH: ${{ github.ref_name != github.event.repository.default_branch }}

- name: Upload Release Artifacts
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ dockers:
goos: linux
goarch: '386'
dockerfile: Dockerfile.goreleaser
skip_push: "{{ if .Env.DEFAULT_BRANCH eq .Major }}false{{ else }}true{{ end }}"
skip_push: "{{ .Env.NOT_DEFAULT_BRANCH }}"
build_flag_templates:
- "--pull"
- "--platform=linux/386"
Expand All @@ -108,7 +108,7 @@ dockers:
goos: linux
goarch: amd64
dockerfile: Dockerfile.goreleaser
skip_push: "{{ if .Env.DEFAULT_BRANCH eq .Major }}false{{ else }}true{{ end }}"
skip_push: "{{ .Env.NOT_DEFAULT_BRANCH }}"
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
Expand All @@ -135,7 +135,7 @@ dockers:
goarch: arm
goarm: 7
dockerfile: Dockerfile.goreleaser
skip_push: "{{ if .Env.DEFAULT_BRANCH eq .Major }}false{{ else }}true{{ end }}"
skip_push: "{{ .Env.NOT_DEFAULT_BRANCH }}"
build_flag_templates:
- "--pull"
- "--platform=linux/arm/v7"
Expand All @@ -160,7 +160,7 @@ dockers:
goos: linux
goarch: arm64
dockerfile: Dockerfile.goreleaser
skip_push: "{{ if .Env.DEFAULT_BRANCH eq .Major }}false{{ else }}true{{ end }}"
skip_push: "{{ .Env.NOT_DEFAULT_BRANCH }}"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
Expand All @@ -183,7 +183,7 @@ docker_manifests:
- "launchdarkly/ld-relay:v{{ .Major }}-i386"

- name_template: "launchdarkly/ld-relay:latest"
skip_push: "{{ if .Env.DEFAULT_BRANCH eq .Major }}false{{ else }}true{{ end }}"
skip_push: "{{ .Env.NOT_DEFAULT_BRANCH }}"
image_templates:
- "launchdarkly/ld-relay:latest-amd64"
- "launchdarkly/ld-relay:latest-armv7"
Expand Down

0 comments on commit 94a3457

Please sign in to comment.