From cf7e148ae0ba04bb107fa2128999ba1e0f5c5dd6 Mon Sep 17 00:00:00 2001 From: Jared Hall Date: Sat, 21 Mar 2026 17:52:48 +1100 Subject: [PATCH 1/5] handle result --- LICENSE | 2 +- cmd/send.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 59c8785..125b2a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 apialerts +Copyright (c) 2026 apialerts Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cmd/send.go b/cmd/send.go index b51705e..dcf9bad 100644 --- a/cmd/send.go +++ b/cmd/send.go @@ -93,9 +93,9 @@ Properties: Data: data, } - result, err := apialerts.SendAsync(event) - if err != nil { - return fmt.Errorf("failed to send: %w", err) + result := apialerts.SendAsync(event) + if !result.Success { + return fmt.Errorf("failed to send: %s", result.Error) } fmt.Printf("✓ Alert sent to %s (%s)\n", result.Workspace, result.Channel) From ff8d2c0fba5fb7ea97b147cb5ea76f38a5691c1f Mon Sep 17 00:00:00 2001 From: Jared Hall Date: Sat, 21 Mar 2026 18:09:41 +1100 Subject: [PATCH 2/5] action updates --- .github/workflows/build-release.yml | 4 ++-- .github/workflows/publish-github.yml | 4 ++-- .github/workflows/pull-request.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 726e54f..039c177 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v6 with: go-version-file: 'go.mod' - name: Test diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 8e58f78..e118609 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -12,11 +12,11 @@ jobs: contents: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v6 with: go-version-file: 'go.mod' - name: Import Apple certificate diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 13a8e41..881b8c3 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v6 with: go-version-file: 'go.mod' - name: Test From 330d202aa08711e393f5a0e1afc51aaa588ec09b Mon Sep 17 00:00:00 2001 From: Jared Hall Date: Sun, 22 Mar 2026 00:24:06 +1100 Subject: [PATCH 3/5] apialerts-go v1.2.0-alpha.6 --- cmd/send.go | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/send.go b/cmd/send.go index dcf9bad..3a436ec 100644 --- a/cmd/send.go +++ b/cmd/send.go @@ -93,9 +93,9 @@ Properties: Data: data, } - result := apialerts.SendAsync(event) - if !result.Success { - return fmt.Errorf("failed to send: %s", result.Error) + result, err := apialerts.SendAsync(event) + if err != nil { + return fmt.Errorf("failed to send: %s", err) } fmt.Printf("✓ Alert sent to %s (%s)\n", result.Workspace, result.Channel) diff --git a/go.mod b/go.mod index a20fefb..66dc836 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/apialerts/cli go 1.25.0 require ( - github.com/apialerts/apialerts-go v1.2.0-alpha.5 + github.com/apialerts/apialerts-go v1.2.0-alpha.6 github.com/spf13/cobra v1.10.2 golang.org/x/term v0.41.0 ) diff --git a/go.sum b/go.sum index 4eafabf..69d4af1 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/apialerts/apialerts-go v1.2.0-alpha.5 h1:NO8XBAJoBOGYq7Di6ld8cQPBZ62NKjnlayvosC6TIJ4= -github.com/apialerts/apialerts-go v1.2.0-alpha.5/go.mod h1:HhLAxT5uQOZUZLXYPSrQJduUYj+yzB6yU3/KjcDT9hU= +github.com/apialerts/apialerts-go v1.2.0-alpha.6 h1:WxBTfc9Dc50wAmaOlg0Mme9M7JY0iJJXb0sw3hPzBnY= +github.com/apialerts/apialerts-go v1.2.0-alpha.6/go.mod h1:HhLAxT5uQOZUZLXYPSrQJduUYj+yzB6yU3/KjcDT9hU= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= From 96c3706f83c9626e2482000f2b0492f7993165dc Mon Sep 17 00:00:00 2001 From: Jared Hall Date: Tue, 7 Apr 2026 02:51:12 +1000 Subject: [PATCH 4/5] Linux distribution to apt/dnf (#3) * attempted linux build * comment out mac os notorize * add back in all deploys * rpm setup * temp remove all deploys other than the rpm release * temp remove github actions for non rpm builds * restore all deploys * sign rpm - temp disable other builds * fix yml * v1.2.3 - revert to keep all builds: go, apt, rpm, windows, mac --------- Co-authored-by: Jared Hall --- .github/workflows/publish-github.yml | 142 ++++++++++++++++++++++++++- .goreleaser.yaml | 12 +++ README.md | 23 +++++ cmd/constants.go | 2 +- 4 files changed, 177 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index e118609..faaebdd 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -38,7 +38,7 @@ jobs: security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@v7 with: version: "~> v2" args: release --clean @@ -61,3 +61,143 @@ jobs: --team-id "$APPLE_TEAM_ID" \ --wait done + + apt: + name: Publish apt repository + runs-on: ubuntu-latest + needs: goreleaser + permissions: + contents: read + steps: + - name: Install dpkg-dev + run: sudo apt-get install -y dpkg-dev + + - name: Checkout apt repo + uses: actions/checkout@v6 + with: + repository: apialerts/apt + token: ${{ secrets.GORELEASER_TOKEN }} + path: apt-repo + + - name: Download .deb packages from release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download ${{ github.event.release.tag_name }} \ + --pattern "*.deb" \ + --dir debs \ + --repo ${{ github.repository }} + + - name: Import GPG key + run: echo "${{ secrets.APT_GPG_PRIVATE_KEY }}" | base64 -d | gpg --batch --import + + - name: Update apt repository + env: + APT_GPG_PASSPHRASE: ${{ secrets.APT_GPG_PASSPHRASE }} + run: | + mkdir -p apt-repo/pool/main/a/apialerts + cp debs/*.deb apt-repo/pool/main/a/apialerts/ + + cd apt-repo + mkdir -p dists/stable/main/binary-amd64 + mkdir -p dists/stable/main/binary-arm64 + + dpkg-scanpackages --arch amd64 pool/ > dists/stable/main/binary-amd64/Packages + gzip -kf dists/stable/main/binary-amd64/Packages + + dpkg-scanpackages --arch arm64 pool/ > dists/stable/main/binary-arm64/Packages + gzip -kf dists/stable/main/binary-arm64/Packages + + gpg --armor --export > key.gpg + + { + echo "Origin: apialerts" + echo "Label: apialerts" + echo "Suite: stable" + echo "Codename: stable" + echo "Architectures: amd64 arm64" + echo "Components: main" + echo "Description: API Alerts apt repository" + echo "Date: $(date -Ru)" + echo "MD5Sum:" + for f in dists/stable/main/binary-*/Packages*; do + printf " %s %s %s\n" "$(md5sum "$f" | cut -d' ' -f1)" "$(wc -c < "$f")" "${f#dists/stable/}" + done + echo "SHA256:" + for f in dists/stable/main/binary-*/Packages*; do + printf " %s %s %s\n" "$(sha256sum "$f" | cut -d' ' -f1)" "$(wc -c < "$f")" "${f#dists/stable/}" + done + } > dists/stable/Release + + gpg --batch --yes --pinentry-mode loopback --passphrase "$APT_GPG_PASSPHRASE" \ + --clearsign -o dists/stable/InRelease dists/stable/Release + gpg --batch --yes --pinentry-mode loopback --passphrase "$APT_GPG_PASSPHRASE" \ + -abs -o dists/stable/Release.gpg dists/stable/Release + + - name: Push apt repo + run: | + cd apt-repo + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git diff --staged --quiet || git commit -m "Release ${{ github.event.release.tag_name }}" + git push + + rpm: + name: Publish rpm repository + runs-on: ubuntu-latest + needs: goreleaser + permissions: + contents: read + steps: + - name: Install createrepo + run: sudo apt-get install -y createrepo-c rpm + + - name: Checkout rpm repo + uses: actions/checkout@v6 + with: + repository: apialerts/rpm + token: ${{ secrets.GORELEASER_TOKEN }} + path: rpm-repo + + - name: Download .rpm packages from release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download ${{ github.event.release.tag_name }} \ + --pattern "*.rpm" \ + --dir rpms \ + --repo ${{ github.repository }} + + - name: Import GPG key + run: echo "${{ secrets.APT_GPG_PRIVATE_KEY }}" | base64 -d | gpg --batch --import + + - name: Update rpm repository + env: + APT_GPG_PASSPHRASE: ${{ secrets.APT_GPG_PASSPHRASE }} + run: | + mkdir -p rpm-repo/packages + cp rpms/*.rpm rpm-repo/packages/ + + gpg --armor --export > rpm-repo/key.gpg + + echo "$APT_GPG_PASSPHRASE" > /tmp/gpg-passphrase + printf '%%_signature gpg\n%%_gpg_name API Alerts \n%%__gpg_sign_cmd %%{__gpg} gpg --batch --no-verbose --no-armor --pinentry-mode loopback --passphrase-file /tmp/gpg-passphrase --no-secmem-warning -u "%%{_gpg_name}" -sbo %%{__signature_filename} %%{__plaintext_filename}\n' > ~/.rpmmacros + for rpm_file in rpm-repo/packages/*.rpm; do + rpmsign --addsign "$rpm_file" + done + rm /tmp/gpg-passphrase + + createrepo_c rpm-repo/ + + gpg --batch --yes --pinentry-mode loopback --passphrase "$APT_GPG_PASSPHRASE" \ + --detach-sign --armor rpm-repo/repodata/repomd.xml + + - name: Push rpm repo + run: | + cd rpm-repo + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git diff --staged --quiet || git commit -m "Release ${{ github.event.release.tag_name }}" + git push diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fab9c6a..f299f5e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -33,6 +33,18 @@ archives: checksum: name_template: "checksums.txt" +nfpms: + - id: packages + package_name: apialerts + vendor: apialerts + homepage: https://apialerts.com + maintainer: API Alerts + description: API Alerts CLI — send events from your terminal + license: MIT + formats: + - deb + - rpm + homebrew_casks: - name: apialerts repository: diff --git a/README.md b/README.md index a0e246e..d42be57 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,29 @@ brew tap apialerts/tap brew install --cask apialerts ``` +### apt (Debian / Ubuntu and derivatives) + +```bash +curl -fsSL https://apt.apialerts.com/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/apialerts.gpg +echo "deb [signed-by=/usr/share/keyrings/apialerts.gpg] https://apt.apialerts.com stable main" | sudo tee /etc/apt/sources.list.d/apialerts.list +sudo apt update && sudo apt install apialerts +``` + +### dnf (Fedora / RHEL / CentOS) + +```bash +sudo rpm --import https://rpm.apialerts.com/key.gpg +sudo tee /etc/yum.repos.d/apialerts.repo < Date: Tue, 7 Apr 2026 03:03:35 +1000 Subject: [PATCH 5/5] 1.3.0 --- cmd/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/constants.go b/cmd/constants.go index 71a44f4..7c735b4 100644 --- a/cmd/constants.go +++ b/cmd/constants.go @@ -2,5 +2,5 @@ package cmd const ( IntegrationName = "apialerts-cli" - Version = "1.2.3" + Version = "1.3.0" )