Skip to content

Commit

Permalink
Add fury release
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Mar 26, 2024
1 parent 7fbd117 commit d4d6fe7
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release to Linux repository

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ^1.22
- name: Publish release
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
version: latest
args: release -f .goreleaser.fury.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
53 changes: 53 additions & 0 deletions .goreleaser.fury.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project_name: serenity
builds:
- id: main
main: ./cmd/serenity
flags:
- -v
- -trimpath
ldflags:
- -X github.com/sagernet/serenity/constant.Version={{ .Version }} -s -w -buildid=
env:
- CGO_ENABLED=0
targets:
- linux_386
- linux_amd64_v1
- linux_arm64
- linux_arm_7
- linux_s390x
- linux_riscv64
mod_timestamp: '{{ .CommitTimestamp }}'
snapshot:
name_template: "{{ .Version }}.{{ .ShortCommit }}"
nfpms:
- &template
id: package
package_name: serenity
file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- main
vendor: sagernet
homepage: https://serenity.sagernet.org/
maintainer: nekohasekai <contact-git@sekai.icu>
description: The configuration generator for sing-box.
license: GPLv3 or later
formats:
- deb
- rpm
priority: extra
contents:
- src: release/config/config.json
dst: /etc/serenity/config.json
type: config
- src: release/config/serenity.service
dst: /etc/systemd/system/serenity.service
- src: release/config/serenity@.service
dst: /etc/systemd/system/serenity@.service
- src: LICENSE
dst: /usr/share/licenses/serenity/LICENSE
release:
disable: true
furies:
- account: sagernet
ids:
- package
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ builds:
- linux_arm64
- linux_arm_7
- linux_s390x
- linux_riscv64
mod_timestamp: '{{ .CommitTimestamp }}'
snapshot:
name_template: "{{ .Version }}.{{ .ShortCommit }}"
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ lint_install:
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest

release:
goreleaser release --clean --skip-publish || exit 1
goreleaser release --clean --skip publish
mkdir dist/release
mv dist/*.tar.gz dist/*.deb dist/*.rpm dist/*.pkg.tar.zst dist/release
ghr --replace --draft --prerelease -p 3 "v${VERSION}" dist/release
rm -r dist/release

release_repo:
go run ./cmd/internal/build goreleaser release -f .goreleaser.fury.yaml --clean

release_install:
go install -v github.com/goreleaser/goreleaser@latest
go install -v github.com/tcnksm/ghr@latest
Expand Down

0 comments on commit d4d6fe7

Please # to comment.