diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..1487557 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser-pro + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..2bd9ddb --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,69 @@ +version: 2 + +project_name: github-to-signal + +before: + hooks: + - go generate ./... + - go mod tidy + +builds: + - id: github-to-signal + main: . + binary: github-to-signal + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + ldflags: + - -s -w + - -X main.version={{.Version}} + - -X main.commit={{.Commit}} + - -X main.date={{.Date}} + +archives: + - id: default + formats: [tar.gz] + name_template: >- + {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} + files: + - LICENSE + - README.md + - config.example.toml + - deploy/* + +nfpms: + - id: packages + package_name: github-to-signal + vendor: taigrr + homepage: https://github.com/taigrr/github-to-signal + maintainer: Tai Groot + description: GitHub webhook to Signal notifications + license: 0BSD + formats: + - deb + - rpm + contents: + - src: deploy/github-to-signal.service + dst: /usr/lib/systemd/user/github-to-signal.service + type: config + - src: deploy/signal-cli-bot.service + dst: /usr/lib/systemd/user/signal-cli-bot.service + type: config + - src: config.example.toml + dst: /etc/github-to-signal/config.example.toml + type: config + +checksum: + name_template: checksums.txt + +changelog: + use: github-native + +release: + github: + owner: taigrr + name: github-to-signal diff --git a/deploy/github-to-signal.nginx.conf b/deploy/github-to-signal.nginx.conf index fe5ed4e..9bfb353 100644 --- a/deploy/github-to-signal.nginx.conf +++ b/deploy/github-to-signal.nginx.conf @@ -1,4 +1,5 @@ server { + listen 80; # listen 443 ssl; server_name ghwebhook.example.com;