Release on Homebrew using GoReleaser (#5)

* Release on Homebrew using GoReleaser

* Add a Build task
This commit is contained in:
Nikolay Edigaryev 2022-06-21 20:56:57 +03:00 committed by GitHub
parent 38a1a31a03
commit c231fd5e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

27
.cirrus.yml Normal file
View File

@ -0,0 +1,27 @@
env:
PATH: "$PATH:$HOME/.cargo/bin"
task:
name: Build
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
install_rust_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
build_script:
- cargo build
task:
name: Release
only_if: $CIRRUS_TAG != ''
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
env:
GITHUB_TOKEN: ENCRYPTED[!98ace8259c6024da912c14d5a3c5c6aac186890a8d4819fad78f3e0c41a4e0cd3a2537dd6e91493952fb056fa434be7c!]
GORELEASER_KEY: ENCRYPTED[!9b80b6ef684ceaf40edd4c7af93014ee156c8aba7e6e5795f41c482729887b5c31f36b651491d790f1f668670888d9fd!]
install_rust_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
install_goreleaser_script:
- brew install go goreleaser/tap/goreleaser-pro
build_script:
- cargo build --release
release_script: goreleaser

32
.goreleaser.yml Normal file
View File

@ -0,0 +1,32 @@
project_name: softnet
builds:
- builder: prebuilt
goos:
- darwin
goarch:
- arm64
prebuilt:
path: target/release/softnet
archives:
- id: binary
format: binary
name_template: "{{ .ProjectName }}"
- id: regular
name_template: "{{ .ProjectName }}"
release:
prerelease: auto
brews:
- name: softnet
ids:
- regular
tap:
owner: cirruslabs
name: homebrew-cli
caveats: See the Github repository for more information
homepage: https://github.com/cirruslabs/softnet
description: Software networking with isolation for Tart
skip_upload: auto