Prepare for itgui cross-compilation

This commit is contained in:
Elara 2022-11-24 16:16:25 -08:00
parent f3f66176b8
commit ff0ead0343
3 changed files with 40 additions and 11 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
/itctl /itctl
/itd /itd
/itgui /itgui*
/version.txt /version.txt
dist/ dist/

View File

@ -14,6 +14,8 @@ builds:
- amd64 - amd64
- arm - arm
- arm64 - arm64
goarm:
- 7
- id: itctl - id: itctl
env: env:
- CGO_ENABLED=0 - CGO_ENABLED=0
@ -26,24 +28,32 @@ builds:
- amd64 - amd64
- arm - arm
- arm64 - arm64
goarm:
- 7
archives: archives:
- replacements: - name_template: >-
386: i386 {{- .ProjectName }}-{{.Version}}-{{.Os}}-
amd64: x86_64 {{- if eq .Arch "386" }}i386
arm64: aarch64 {{- else if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{.Arch}}
{{- end }}
files: files:
- LICENSE - LICENSE
- README.md - README.md
- itd.toml - itd.toml
- itd.service - itd.service
- itgui-linux-{{.Arch}}{{if eq .Arch "arm"}}-7{{end}}
nfpms: nfpms:
- id: itd - id: itd
file_name_template: '{{.PackageName}}-{{.Version}}-{{.Os}}-{{.Arch}}' file_name_template: >-
{{- .PackageName }}-{{.Version}}-{{.Os}}-
{{- if eq .Arch "386" }}i386
{{- else if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{.Arch}}
{{- end }}
description: "Companion daemon for the InfiniTime firmware on the PineTime smartwatch" description: "Companion daemon for the InfiniTime firmware on the PineTime smartwatch"
replacements:
386: i386
amd64: x86_64
arm64: aarch64
homepage: 'https://gitea.arsenm.dev/Arsen6331/itd' homepage: 'https://gitea.arsenm.dev/Arsen6331/itd'
maintainer: 'Arsen Musyaelyan <arsen@arsenm.dev>' maintainer: 'Arsen Musyaelyan <arsen@arsenm.dev>'
license: GPLv3 license: GPLv3
@ -54,12 +64,15 @@ nfpms:
dependencies: dependencies:
- dbus - dbus
- bluez - bluez
- pulseaudio-utils
contents: contents:
- src: itd.toml - src: itd.toml
dst: /etc/itd.toml dst: /etc/itd.toml
type: "config|noreplace" type: "config|noreplace"
- src: itd.service - src: itd.service
dst: /usr/lib/systemd/user/itd.service dst: /usr/lib/systemd/user/itd.service
- src: itgui-linux-{{.Arch}}{{if eq .Arch "arm"}}-7{{end}}
dst: /usr/bin/itgui
aurs: aurs:
- name: itd-bin - name: itd-bin
homepage: 'https://gitea.arsenm.dev/Arsen6331/itd' homepage: 'https://gitea.arsenm.dev/Arsen6331/itd'
@ -82,6 +95,10 @@ aurs:
# binaries # binaries
install -Dm755 "./itd" "${pkgdir}/usr/bin/itd" install -Dm755 "./itd" "${pkgdir}/usr/bin/itd"
install -Dm755 "./itctl" "${pkgdir}/usr/bin/itctl" install -Dm755 "./itctl" "${pkgdir}/usr/bin/itctl"
install -Dm755 "./itgui" "${pkgdir/usr/bin/itgui}"
# desktop files
install -Dm644 "./itgui.desktop" "${pkgdir}/usr/share/applications/itgui.desktop"
# service # service
install -Dm644 "./itd.service" ${pkgdir}/usr/lib/systemd/user/itd.service install -Dm644 "./itd.service" ${pkgdir}/usr/lib/systemd/user/itd.service

View File

@ -1,8 +1,20 @@
pipeline: pipeline:
xgo-itgui:
image: arsen6331/fyne-xgo
environment:
- 'TARGETS=linux/amd64 linux/arm64 linux/386 linux/arm-7'
- 'OUT=itgui'
- 'PACK=./cmd/itgui'
commands:
- export SOURCE_DIR=$${CI_WORKSPACE} OUT_DIR=$${CI_WORKSPACE}
- /build.sh
when:
event: tag
release: release:
image: goreleaser/goreleaser image: goreleaser/goreleaser
commands: commands:
- goreleaser release - goreleaser release
secrets: [ gitea_token, aur_key ] secrets: [ gitea_token, aur_key ]
when: when:
event: tag event: tag