Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace PPA with Gemfury for APT packages #203

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/cd_gemfury.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Build and release ipinfo cli to gemfury (apt)

name: Release to Gemfury
on:
push:
tags:
- 'ipinfo-*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup GO
uses: actions/setup-go@v3
with:
go-version: '1.20'

- name: Extract CLI Name and Version
run: |
# Get the tag name from the event payload
TAG_NAME=${{ github.ref_name }}

# Use a regular expression to extract the CLI name and version
if [[ $TAG_NAME =~ ^([^-]+)-([^-]+)$ ]]; then
CLI_NAME="${BASH_REMATCH[1]}"
CLI_VERSION="${BASH_REMATCH[2]}"

echo "CLI Name: $CLI_NAME"
echo "CLI Version: $CLI_VERSION"

# Add to github env
echo "CLI_NAME=$CLI_NAME" >> $GITHUB_ENV
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
else
echo "Invalid tag format: $TAG_NAME"
echo "Tag should be of format CLI-VSN. e.g. ipinfo-1.0.0"
exit 1
fi

- name: Build
run: ./scripts/build-archive-all.sh ${{ env.CLI_NAME }} ${{ env.CLI_VERSION }} true

- name: Install dependencies
run: |
echo "deb [trusted=yes] https://apt.fury.io/cli/ * *" | sudo tee /etc/apt/sources.list.d/fury-cli.list
sudo apt-get update
sudo apt-get install -y fury-cli

- name: Upload
run: |
fury push ./build/${{ env.CLI_NAME }}_${{ env.CLI_VERSION }}_linux_*.deb --api-token ${{ secrets.IPINFO_GEMFURY_PUSH_TOKEN }}
59 changes: 0 additions & 59 deletions .github/workflows/cd_ppa.yaml

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ OR to install the latest `amd64` version without automatic updates:
curl -Ls https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/macos.sh | sh
```

### Ubuntu PPA
### Ubuntu APT
abu-usama marked this conversation as resolved.
Show resolved Hide resolved

_Note_: this installs our full suite of binaries and keeps them up-to-date.

```bash
sudo add-apt-repository ppa:ipinfo/ppa
echo "deb [trusted=yes] https://apt.fury.io/ipinfo/ /" | sudo tee "/etc/apt/sources.list.d/ipinfo.fury.list"
sudo apt update
sudo apt install ipinfo
```

### Debian / Ubuntu (amd64)
### Debian / Ubuntu

_Note_: this is a one-time installation; updates are not automatic. Use the PPA
for automatic updates.
Expand All @@ -49,9 +49,10 @@ curl -Ls https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/deb.sh | s
OR

```bash
curl -LO https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/ipinfo_3.3.0.deb
sudo dpkg -i ipinfo_3.3.0.deb
curl -LO https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/ipinfo_3.3.0_linux_{arch}.deb
sudo dpkg -i ipinfo_3.3.0_linux_{arch}.deb
```
where `{arch}` can be 386, amd64, arm, or arm64.
abu-usama marked this conversation as resolved.
Show resolved Hide resolved

### FreeBSD

Expand Down Expand Up @@ -147,7 +148,7 @@ curl -LO https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/ipinfo_3.3
wget https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.0/ipinfo_3.3.0_${PLAT}.tar.gz

tar -xvf ipinfo_3.3.0_${PLAT}.tar.gz
mv ipinfo_3.3.0_${PLAT} /usr/local/bin/ipinfo
sudo mv ipinfo_3.3.0_${PLAT} /usr/local/bin/ipinfo
```

### Using `git`
Expand Down
26 changes: 23 additions & 3 deletions cidr2ip/deb.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
#!/bin/sh

VSN=1.0.0
DEFAULT_ARCH=amd64

curl -LO https://github.com/ipinfo/cli/releases/download/cidr2ip-${VSN}/cidr2ip_${VSN}.deb
sudo dpkg -i cidr2ip_${VSN}.deb
rm cidr2ip_${VSN}.deb
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH_NAME="amd64"
;;
i386|i686)
ARCH_NAME="386"
;;
aarch64)
ARCH_NAME="arm64"
;;
armv7l)
ARCH_NAME="arm"
;;
*)
ARCH_NAME=$DEFAULT_ARCH
;;
esac

curl -LO https://github.com/ipinfo/cli/releases/download/cidr2ip-${VSN}/cidr2ip_${VSN}_linux_${ARCH_NAME}.deb
sudo dpkg -i cidr2ip_${VSN}_linux_${ARCH_NAME}.deb
rm cidr2ip_${VSN}_linux_${ARCH_NAME}.deb

echo
echo 'You can now run `cidr2ip`'.
Expand Down
25 changes: 22 additions & 3 deletions cidr2range/deb.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/bin/sh

VSN=1.2.0
DEFAULT_ARCH=amd64

curl -LO https://github.com/ipinfo/cli/releases/download/cidr2range-${VSN}/cidr2range_${VSN}.deb
sudo dpkg -i cidr2range_${VSN}.deb
rm cidr2range_${VSN}.deb
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH_NAME="amd64"
;;
i386|i686)
ARCH_NAME="386"
;;
aarch64)
ARCH_NAME="arm64"
;;
armv7l)
ARCH_NAME="arm"
;;
*)
ARCH_NAME=$DEFAULT_ARCH
;;
esac
curl -LO https://github.com/ipinfo/cli/releases/download/cidr2range-${VSN}/cidr2range_${VSN}_linux_${ARCH_NAME}.deb
sudo dpkg -i cidr2range_${VSN}_linux_${ARCH_NAME}.deb
rm cidr2range_${VSN}_linux_${ARCH_NAME}.deb

echo
echo 'You can now run `cidr2range`'.
Expand Down
5 changes: 0 additions & 5 deletions debian/changelog

This file was deleted.

16 changes: 0 additions & 16 deletions debian/control

This file was deleted.

19 changes: 0 additions & 19 deletions debian/copyright

This file was deleted.

1 change: 0 additions & 1 deletion debian/files

This file was deleted.

3 changes: 0 additions & 3 deletions debian/rules

This file was deleted.

5 changes: 0 additions & 5 deletions debian/upstream/metadata

This file was deleted.

5 changes: 0 additions & 5 deletions debian/watch

This file was deleted.

25 changes: 22 additions & 3 deletions grepdomain/deb.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/bin/sh

VSN=1.0.0
DEFAULT_ARCH=amd64

curl -LO https://github.com/ipinfo/cli/releases/download/grepdomain-${VSN}/grepdomain_${VSN}.deb
sudo dpkg -i grepdomain_${VSN}.deb
rm grepdomain_${VSN}.deb
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH_NAME="amd64"
;;
i386|i686)
ARCH_NAME="386"
;;
aarch64)
ARCH_NAME="arm64"
;;
armv7l)
ARCH_NAME="arm"
;;
*)
ARCH_NAME=$DEFAULT_ARCH
;;
esac
curl -LO https://github.com/ipinfo/cli/releases/download/grepdomain-${VSN}/grepdomain_${VSN}_linux_${ARCH_NAME}.deb
sudo dpkg -i grepdomain_${VSN}_linux_${ARCH_NAME}.deb
rm grepdomain_${VSN}_linux_${ARCH_NAME}.deb

echo
echo 'You can now run `grepdomain`'.
Expand Down
25 changes: 22 additions & 3 deletions grepip/deb.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/bin/sh

VSN=1.2.3
DEFAULT_ARCH=amd64

curl -LO https://github.com/ipinfo/cli/releases/download/grepip-${VSN}/grepip_${VSN}.deb
sudo dpkg -i grepip_${VSN}.deb
rm grepip_${VSN}.deb
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH_NAME="amd64"
;;
i386|i686)
ARCH_NAME="386"
;;
aarch64)
ARCH_NAME="arm64"
;;
armv7l)
ARCH_NAME="arm"
;;
*)
ARCH_NAME=$DEFAULT_ARCH
;;
esac
curl -LO https://github.com/ipinfo/cli/releases/download/grepip-${VSN}/grepip_${VSN}_linux_${ARCH_NAME}.deb
sudo dpkg -i grepip_${VSN}_linux_${ARCH_NAME}.deb
rm grepip_${VSN}_linux_${ARCH_NAME}.deb

echo
echo 'You can now run `grepip`'.
Expand Down
4 changes: 3 additions & 1 deletion ipinfo/build-all-platforms.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

# Build binary for all platforms for version $1.
# Optional param LINUX_ONLY can be set to `true`, to build for linux only.

set -e

DIR=`dirname $0`
ROOT=$DIR/..

VSN=$1
LINUX_ONLY=$2

$ROOT/scripts/build-all-platforms.sh "ipinfo" $VSN
$ROOT/scripts/build-all-platforms.sh "ipinfo" $VSN $LINUX_ONLY
Loading