Skip to content

Commit

Permalink
Merge pull request #3 from rusq/goreleaser
Browse files Browse the repository at this point in the history
goreleaser and deps bump
  • Loading branch information
rusq authored Feb 22, 2023
2 parents 7e1ea46 + a28bb64 commit e83c884
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 65 deletions.
65 changes: 29 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,35 @@
name: Release Go Binaries
name: goreleaser

on:
release:
types: [created]
workflow_dispatch:

env:
CMD_PATH: ./
on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
releases-matrix:
name: Release Matrix
goreleaser:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64]
exclude:
- goarch: "386"
goos: darwin
steps:
- uses: actions/checkout@v2

- name: Set APP_VERSION env
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}
- name: Set BUILD_TIME env
run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV}
- name: Environment Printer
uses: managedkaos/print-env@v1.0

- uses: wangyoucao577/go-release-action@v1.28
with:
github_token: ${{ secrets.ACTIONS_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.18"
project_path: "${{ env.CMD_PATH }}"
build_flags: -v
ldflags: -X "main.version=${{ env.APP_VERSION }}" -X "main.builtOn=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
extra_files: LICENCE README.md
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.5'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
#executable
wipemychat
wipemychat.exe

dist/
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- netbsd
- freebsd

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ fuzz:
cleanfiles:
-rm -rf tdlib-db tdlib-files

dist:
goreleaser check
goreleaser release --snapshot --rm-dist -p 2
.PHONY: dist
cleanall: clean cleanfiles
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ module github.com/rusq/wipemychat
go 1.18

require (
github.com/fatih/color v1.13.0
github.com/gdamore/tcell/v2 v2.5.3
github.com/gotd/td v0.73.0
github.com/joho/godotenv v1.4.0
github.com/fatih/color v1.14.1
github.com/gdamore/tcell/v2 v2.6.0
github.com/gotd/td v0.76.0
github.com/joho/godotenv v1.5.1
github.com/looplab/fsm v0.3.0
github.com/rivo/tview v0.0.0-20221128165837-db36428c92d9
github.com/rivo/tview v0.0.0-20230208211350-7dfff1ce7854
github.com/rusq/dlog v1.3.3
github.com/rusq/mtpwrap v0.0.1
github.com/rusq/mtpwrap v0.0.4
github.com/rusq/osenv/v2 v2.0.1
github.com/rusq/tracer v1.0.1
github.com/schollz/progressbar/v3 v3.12.2
github.com/schollz/progressbar/v3 v3.13.0
)

require (
Expand All @@ -22,32 +22,32 @@ require (
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/go-faster/errors v0.6.1 // indirect
github.com/go-faster/jx v0.40.0 // indirect
github.com/go-faster/jx v0.41.0 // indirect
github.com/go-faster/xor v0.3.0 // indirect
github.com/gotd/contrib v0.13.0 // indirect
github.com/gotd/ige v0.2.2 // indirect
github.com/gotd/neo v0.1.5 // indirect
github.com/klauspost/compress v1.15.12 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rusq/encio v0.1.0 // indirect
github.com/rusq/secure v0.0.4 // indirect
github.com/segmentio/asm v1.2.0 // indirect
go.opentelemetry.io/otel v1.11.2 // indirect
go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.opentelemetry.io/otel v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.3.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
rsc.io/qr v0.2.0 // indirect
)
Loading

0 comments on commit e83c884

Please sign in to comment.