Skip to content

Commit

Permalink
Upgrade release process, include nfpms and homebrew
Browse files Browse the repository at this point in the history
- upgrade goreleaser to 1.12.2
- upgrade build vm to macos-12
- add goreleaser nfpms linux packages build
- update docs with build process involving Homebrew
  • Loading branch information
jrslv committed Nov 2, 2022
1 parent 7fa0d6e commit 43ea6ad
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 11 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,38 @@ permissions:
contents: write
jobs:
release:
runs-on: macos-11
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: Import certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}

- name: Install gon via homebrew
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: v1.7.0
args: release --rm-dist
version: v1.12.2
args: release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
APPLE_ID_AC_PASSWORD: ${{ secrets.APPLE_ID_AC_PASSWORD }}
45 changes: 42 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
project_name: binocs
builds:
- id: binocs
- id: binocs-linux
binary: binocs
goos:
- linux
goarch:
- 386
- amd64
- arm64
goamd64:
- v1
- id: binocs-windows
binary: binocs
goos:
- windows
goarch:
- 386
- amd64
- arm64
goamd64:
- v1
- id: binocs-macos-amd64
binary: binocs
goos:
- darwin
goarch:
- amd64
goamd64:
- v1
hooks:
post:
- cmd: 'gon -log-level=debug -log-json gon.amd64.json'
- cmd: 'gon -log-level=info -log-json gon.amd64.json'
output: true
- id: binocs-macos-arm64
binary: binocs
Expand All @@ -27,11 +40,37 @@ builds:
- arm64
hooks:
post:
- cmd: 'gon -log-level=debug -log-json gon.arm64.json'
- cmd: 'gon -log-level=info -log-json gon.arm64.json'
output: true
archives:
- format: binary
checksum:
algorithm: sha256
changelog:
sort: asc
nfpms:
-
id: binocs
package_name: binocs
file_name_template: "{{ .ConventionalFileName }}"
builds:
- binocs-linux
vendor: Binocs
homepage: https://binocs.sh/
maintainer: Jaroslav Holub <[email protected]>
description: |-
Binocs is a CLI-first uptime and performance monitoring tool for websites, applications and APIs.
formats:
- apk
- deb
- rpm
bindir: /usr/bin
rpm:
group: Unspecified
compression: gzip
deb:
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package
# apk:

25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,34 @@ $ git push origin master
$ git push origin v0.4.0
```

Download binaries to `~/Code/automato/binocs-download/public/`
### 4. Execute post-GitHub Actions script

This will
- fetch assets from the GitHub Release
- zip files for Homebrew
- add files to github.com/automato-io/binocs-downloads
- sync files with download.binocs.sh

```shell
$ cd ~/Code/automato/binocs-download/
$ ./update 0.4.0
$ ./sync
```

Release `binocs-website`
### 5. Release website with updated downloads

Trigger GitHub Actions

### 6. Create a Homebrew PR

- create a branch in `~/Code/automato/homebrew-cask/`
- update `sha256` and `version` in `Casks/binocs.rb`
- use `brew bump-cask-pr` command to bump version

## Testing the continuous integration pipeline

```shell
git push --delete origin v69.1.0 && git tag -d v69.1.0 && git tag -a v69.1.0 -m "release v69.1.0" && git push origin v69.1.0
```

## Develop completions

Expand Down
4 changes: 2 additions & 2 deletions gon.amd64.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": [
"./dist/binocs-macos-amd64_darwin_amd64/binocs"
"./dist/binocs-macos-amd64_darwin_amd64_v1/binocs"
],
"bundle_id": "sh.binocs.macos",
"apple_id": {
Expand All @@ -11,6 +11,6 @@
"application_identity" : "586F6651E48ABDA71C8F6E1BD195E65377C337C6"
},
"zip": {
"output_path": "./dist/binocs-macos-amd64_darwin_amd64/binocs.zip"
"output_path": "./dist/binocs-macos-amd64_darwin_amd64_v1/binocs.zip"
}
}

0 comments on commit 43ea6ad

Please sign in to comment.