-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate deb packaging to GoReleaser (#87)
* Makefile: Use install(1) instead of cp(1) * Use GoReleaser to generate deb package * Add postinstall script * Add preremove script
- Loading branch information
Showing
6 changed files
with
57 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
version: 2 | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- | ||
id: yukid | ||
- id: yukid | ||
binary: yukid | ||
env: | ||
- CGO_ENABLED=0 | ||
|
@@ -16,8 +16,7 @@ builds: | |
- -trimpath | ||
ldflags: | ||
- -s -w -X github.com/ustclug/Yuki/pkg/info.Version={{.Version}} -X github.com/ustclug/Yuki/pkg/info.BuildDate={{.Date}} -X github.com/ustclug/Yuki/pkg/info.GitCommit={{.Commit}} | ||
- | ||
id: yukictl | ||
- id: yukictl | ||
binary: yukictl | ||
env: | ||
- CGO_ENABLED=0 | ||
|
@@ -30,6 +29,11 @@ builds: | |
- -trimpath | ||
ldflags: | ||
- -s -w -X github.com/ustclug/Yuki/pkg/info.Version={{.Version}} -X github.com/ustclug/Yuki/pkg/info.BuildDate={{.Date}} -X github.com/ustclug/Yuki/pkg/info.GitCommit={{.Commit}} | ||
hooks: | ||
post: | ||
- cmd: sh -c "{{ .Path }} completion bash > bash_completion" | ||
dir: "{{ dir (dir .Path) }}" | ||
output: true | ||
archives: | ||
- format: binary | ||
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}" | ||
|
@@ -39,6 +43,36 @@ snapshot: | |
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
use: github-native | ||
nfpms: | ||
- id: default | ||
package_name: yuki | ||
homepage: https://github.com/ustclug/Yuki | ||
maintainer: "USTC LUG <[email protected]>" | ||
description: |- | ||
USTC Mirror Manager | ||
formats: | ||
- deb | ||
umask: 0o022 | ||
dependencies: | ||
- "docker.io | docker-engine | docker-ce" | ||
section: admin | ||
priority: extra | ||
provides: | ||
- yukid | ||
- yukictl | ||
scripts: | ||
postinstall: etc/postinst.sh | ||
preremove: etc/prerm.sh | ||
contents: | ||
- src: dist/bash_completion | ||
dst: /etc/bash_completion.d/yukictl | ||
- src: etc/daemon.example.toml | ||
dst: /etc/yuki/ | ||
- src: etc/yukid.service | ||
dst: /lib/systemd/system/ | ||
- src: yukictl | ||
dst: /usr/bin/yuki | ||
type: symlink | ||
|
||
# modelines, feel free to remove those if you don't want/use them: | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Only run if systemd is running | ||
[ -d /run/systemd ] || exit 0 | ||
|
||
systemctl enable yukid.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Only run if systemd is running | ||
[ -d /run/systemd ] || exit 0 | ||
|
||
systemctl disable --now yukid.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters