Skip to content

Commit

Permalink
Add pre-built binary targets to release pipeline (#324)
Browse files Browse the repository at this point in the history
* add new pre-built binaries

* add pre-built targets to (roughly) match the restic pre-built binaries

* remove go generate step and move mockery to Makefile

* priority tests still not working on the CI runners

* fix path on WIndows

* add mocks to the repository

* fix checksum file name

* fix install.sh generated file

* remove "hardfloat" from mips* package names

* add open containers labels to images

* add doc & source labels

* finish setting up weekly image rebuilt
  • Loading branch information
creativeprojects committed Feb 20, 2024
1 parent 233e4b8 commit 2ab1f3a
Show file tree
Hide file tree
Showing 16 changed files with 3,191 additions and 91 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ jobs:
with:
node-version: 18

- name: Build
run: make build
- name: Test
run: make test-ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test
run: "go test -v -race -short -coverprofile='coverage.out' ./..."
shell: bash
- name: Build
run: make build

- name: Code coverage with codecov
uses: codecov/codecov-action@v4
Expand Down
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/.idea
/.vscode/*log

# legacy python version
/.pytest_cache
/scripts/deploy.sh
*.pyc
/src/resticprofile.egg-info
/**/.eggs

.DS_Store
/examples/private
/build/restic*
Expand All @@ -21,8 +14,7 @@
# test output
/coverage.out

# mocks & mock binaries
mocks
# mock binaries
/mock
/echo
/lock/locktest
Expand Down
95 changes: 60 additions & 35 deletions .godownloader.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,77 @@
project_name: resticprofile

builds:
- id: resticprofile_targz
- id: darwin_targz
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- arm64
- id: freebsd_targz
env:
- CGO_ENABLED=0
goos:
- freebsd
goarch:
- "386"
- amd64
- arm
goarm:
- "6"
- "7"
- id: linux_targz
env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- mips
- mips64
- mips64le
- mipsle
- ppc64
- ppc64le
- riscv64
- s390x
goarm:
- "6"
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- id: netbsd_targz
env:
- CGO_ENABLED=0
goos:
- netbsd
goarch:
- amd64
- id: openbsd_targz
env:
- CGO_ENABLED=0
goos:
- openbsd
goarch:
- "386"
- amd64
- id: solaris_targz
env:
- CGO_ENABLED=0
goos:
- solaris
goarch:
- amd64
- id: windows_targz
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- "386"
- amd64

- id: resticprofile_zip
env:
Expand All @@ -42,27 +86,8 @@ builds:
ignore:
- goos: darwin
goarch: "386"
- goos: windows
goarch: arm

archives:
- id: targz
builds:
- resticprofile_targz
format: tar.gz

- id: zip
builds:
- resticprofile_zip
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
name_template: 'checksums.txt'
16 changes: 12 additions & 4 deletions .goreleaser-docker-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ dockers:
- build/restic-amd64
- build/rclone-amd64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- "--build-arg=ARCH=amd64"
skip_push: true # remove after Sunday

- image_templates:
- "creativeprojects/resticprofile:latest-arm64v8"
- "creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8"
Expand All @@ -55,21 +60,24 @@ dockers:
- build/restic-arm64
- build/rclone-arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64/v8"
- "--build-arg=ARCH=arm64"
skip_push: true # remove after Sunday

docker_manifests:
- name_template: creativeprojects/resticprofile:{{ .RawVersion }}
image_templates:
- creativeprojects/resticprofile:{{ .RawVersion }}-amd64
- creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8
skip_push: true # remove after Sunday

- name_template: creativeprojects/resticprofile:latest
image_templates:
- creativeprojects/resticprofile:latest-amd64
- creativeprojects/resticprofile:latest-arm64v8
skip_push: true # remove after Sunday

release:
disable: true
10 changes: 10 additions & 0 deletions .goreleaser-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ dockers:
- build/restic-amd64
- build/rclone-amd64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- "--build-arg=ARCH=amd64"
- image_templates:
Expand All @@ -52,5 +57,10 @@ dockers:
- build/restic-arm64
- build/rclone-arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64/v8"
- "--build-arg=ARCH=arm64"
44 changes: 37 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,47 @@ builds:
- darwin
- freebsd
- linux
- netbsd
- openbsd
- solaris
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- mips
- mips64
- mips64le
- mipsle
- ppc64
- ppc64le
- riscv64
- s390x
goarm:
- "6"
- "7"
ignore:
- goos: darwin
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: riscv64
- goos: netbsd
goarch: "386"
- goos: darwin
- goos: netbsd
goarch: arm
- goos: freebsd
- goos: netbsd
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: openbsd
goarch: arm
- goos: openbsd
goarch: arm64
- goos: openbsd
goarch: ppc64

- id: resticprofile_zip
env:
Expand All @@ -48,9 +69,6 @@ builds:
- "386"
- amd64
- arm64
ignore:
- goos: darwin
goarch: "386"

- id: resticprofile_no_self_update
env:
Expand Down Expand Up @@ -86,17 +104,19 @@ archives:
- id: targz
builds:
- resticprofile_targz
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: tar.gz

- id: targz_no_self_update
builds:
- resticprofile_no_self_update
name_template: '{{ .ProjectName }}_no_self_update_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
name_template: '{{ .ProjectName }}_no_self_update_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: tar.gz

- id: zip
builds:
- resticprofile_zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: zip

checksum:
Expand Down Expand Up @@ -126,6 +146,11 @@ dockers:
- build/restic-amd64
- build/rclone-amd64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- "--build-arg=ARCH=amd64"
- image_templates:
Expand All @@ -141,6 +166,11 @@ dockers:
- build/restic-arm64
- build/rclone-arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64/v8"
- "--build-arg=ARCH=arm64"

Expand Down
Loading

0 comments on commit 2ab1f3a

Please sign in to comment.