Skip to content

Commit

Permalink
Build on PR + goreleaser deprecation fixes (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmilyOrg committed Jun 27, 2023
2 parents f61e343 + 22b8476 commit 9c582f7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: goreleaser

on:
push:
# run only against tags
tags:
- '*'
pull_request:
types: [opened, synchronize]

permissions:
contents: write
Expand All @@ -23,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20
go-version-file: 'go.mod'

- name: Set up Node
uses: actions/setup-node@v3
Expand All @@ -37,11 +38,22 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
- name: Run GoReleaser (Push)
if: github.event_name == 'push'
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser (PR)
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 10 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ dockers:
- "ghcr.io/smilyorg/photofield:v{{ .Major }}"
- "ghcr.io/smilyorg/photofield:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/smilyorg/photofield:latest"
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
archives:
- format: zip
name_template: >-
{{ .ProjectName }}_
{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ build-ui:
cd ui && npm run build

build-local:
goreleaser build --snapshot --single-target --rm-dist
goreleaser build --snapshot --single-target --clean

release-local:
goreleaser release --snapshot --skip-publish --rm-dist
goreleaser release --snapshot --clean

run *args: build
./photofield {{args}}
Expand Down

0 comments on commit 9c582f7

Please sign in to comment.