From 43ea6ad01044d9143d5720b9f9f9411018e313df Mon Sep 17 00:00:00 2001 From: Jaroslav Holub Date: Sat, 29 Oct 2022 21:16:24 +0200 Subject: [PATCH] Upgrade release process, include nfpms and homebrew - 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 --- .github/workflows/release.yaml | 11 ++++++--- .goreleaser.yaml | 45 +++++++++++++++++++++++++++++++--- README.md | 25 ++++++++++++++++--- gon.amd64.json | 4 +-- 4 files changed, 74 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e54b10f..47b4660 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ffb4c1b..b42c17e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 @@ -27,7 +40,7 @@ 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 @@ -35,3 +48,29 @@ 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 + 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: + \ No newline at end of file diff --git a/README.md b/README.md index c439ac1..4a8dccf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/gon.amd64.json b/gon.amd64.json index dd654a1..fe04fbe 100644 --- a/gon.amd64.json +++ b/gon.amd64.json @@ -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": { @@ -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" } } \ No newline at end of file