Skip to content

Commit

Permalink
Build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Jan 20, 2024
1 parent b0f6a6c commit 3b7cab0
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codetests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: 'v1.55'
version: 'v1.54'
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build-and-release
on:
push:
branches:
- unstable
- main
tags:
- v*
pull_request:
branches:
- main

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Install RPM tooling
run: sudo apt-get install -y rpm
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
- name: "Setup Ruby for packagecloud uploads"
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: "Install packagecloud gem"
run: gem install package_cloud
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.5'
cache: true
- name: "Create GPG_SIGNING_KEY file"
run: "echo '${{ secrets.GPG_SIGNING_KEY }}' > /tmp/key.gpg"
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Use a fine grained PAT with Contents: R/W on golift/homebrew-mugs.
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
GPG_SIGNING_KEY: /tmp/key.gpg
GPG_SIGNING_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/xt
/xt.*
/dist/
115 changes: 115 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
version: 1

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:
# notice that we need a separated build for the MacOS binary only:
- env:
- CGO_ENABLED=0
- CGO_LDFLAGS=-mmacosx-version-min=10.8
- CGO_CFLAGS=-mmacosx-version-min=10.8
id: macos
goos:
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X "golift.io/version.Version={{.Version}}"
- -X "golift.io/version.BuildDate={{.Date}}"
- -X "golift.io/version.BuildUser={{.Env.USER}}"
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- freebsd
goarch:
- amd64
- arm
- arm64
- '386'
ldflags:
- -s -w
- -X "golift.io/version.Version={{.Version}}"
- -X "golift.io/version.BuildDate={{.Date}}"
- -X "golift.io/version.BuildUser={{.Env.USER}}"
ignore:
- goos: windows
goarch: arm


archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip

nfpms:
- id: xt-packages
vendor: Go Lift
homepage: https://unpackerr.com
maintainer: David Newhall II <captain at golift dot io>
description: eXtractor Tool - Recursively decompress archives
license: MIT
formats:
- deb
- rpm
- archlinux
- apk
bindir: /usr/bin
version_metadata: git
section: default
priority: extra
provides:
- xt
# signing
rpm:
signature:
key_file: "{{ .Env.GPG_SIGNING_KEY }}"
deb:
signature:
key_file: "{{ .Env.GPG_SIGNING_KEY }}"
type: origin

universal_binaries:
- replace: true

signs:
- id: default
artifacts: all

brews:
- name: xt
# enable the line below only for testing locally
#skip_upload: true
repository:
owner: golift
name: homebrew-mugs
branch: master
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: [email protected]
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
folder: Formula
homepage: https://unpackerr.com/
description: "eXtractor Tool - Recursively decompress archives"
license: MIT
url_template: "https://github.com/Unpackerr/xt/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
test: assert_match "xt v#{version}", shell_output("#{bin}/xt -v 2>&1", 2)
install: bin.install "xt"


changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# xt
# eXtractor Tool

Extract Everything. Decompress entire folders filled with archives.

Expand Down

0 comments on commit 3b7cab0

Please sign in to comment.