Skip to content

Commit 92611b1

Browse files
committed
chore: compress builds
1 parent 855df4f commit 92611b1

6 files changed

Lines changed: 59 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,24 @@ jobs:
4242
include:
4343
- os: ubuntu-latest
4444
target: linux-x64
45-
artifact: certman-linux-x64
45+
platform: linux
46+
arch: amd64
4647
- os: ubuntu-latest
4748
target: linux-arm64
48-
artifact: certman-linux-arm64
49+
platform: linux
50+
arch: arm64
4951
- os: macos-latest
5052
target: darwin-x64
51-
artifact: certman-darwin-x64
53+
platform: darwin
54+
arch: amd64
5255
- os: macos-latest
5356
target: darwin-arm64
54-
artifact: certman-darwin-arm64
57+
platform: darwin
58+
arch: arm64
5559
- os: windows-latest
5660
target: windows-x64
57-
artifact: certman-windows-x64.exe
61+
platform: windows
62+
arch: amd64
5863

5964
runs-on: ${{ matrix.os }}
6065

@@ -72,13 +77,30 @@ jobs:
7277
run: bun run build
7378

7479
- name: Build binary
75-
run: bun build dist/index.js --compile --target=bun-${{ matrix.target }} --outfile=${{ matrix.artifact }}
80+
shell: bash
81+
run: |
82+
BINARY_NAME="certman-${{ matrix.platform }}-${{ matrix.arch }}"
83+
if [ "${{ matrix.platform }}" = "windows" ]; then
84+
bun build dist/index.js --compile --target=bun-${{ matrix.target }} --outfile="${BINARY_NAME}.exe"
85+
else
86+
bun build dist/index.js --compile --target=bun-${{ matrix.target }} --outfile="${BINARY_NAME}"
87+
fi
88+
89+
- name: Create tar.gz archive
90+
shell: bash
91+
run: |
92+
BINARY_NAME="certman-${{ matrix.platform }}-${{ matrix.arch }}"
93+
if [ "${{ matrix.platform }}" = "windows" ]; then
94+
tar -czvf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}.exe"
95+
else
96+
tar -czvf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}"
97+
fi
7698
7799
- name: Upload artifact
78100
uses: actions/upload-artifact@v6
79101
with:
80-
name: ${{ matrix.artifact }}
81-
path: ${{ matrix.artifact }}
102+
name: certman-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
103+
path: certman-*.tar.gz
82104
retention-days: 7
83105

84106
build-deb:
@@ -94,8 +116,13 @@ jobs:
94116
- name: Download linux binary
95117
uses: actions/download-artifact@v7
96118
with:
97-
name: certman-linux-${{ matrix.arch == 'amd64' && 'x64' || 'arm64' }}
98-
path: bin/
119+
name: certman-linux-${{ matrix.arch }}.tar.gz
120+
path: .
121+
122+
- name: Extract binary
123+
run: |
124+
mkdir -p bin
125+
tar -xzvf "certman-linux-${{ matrix.arch }}.tar.gz" -C bin/
99126
100127
- name: Build Debian package
101128
run: |
@@ -105,7 +132,7 @@ jobs:
105132
- name: Upload artifact
106133
uses: actions/upload-artifact@v6
107134
with:
108-
name: certman-${{ matrix.arch }}.deb
135+
name: certman-linux-${{ matrix.arch }}.deb
109136
path: deb/*.deb
110137
retention-days: 7
111138

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ npm install -g @certman/cli
2121
Download pre-built binaries from the [releases page](https://github.com/certman/certman-cli/releases).
2222

2323
Available for:
24-
- Linux (x64, arm64)
25-
- macOS (x64, arm64)
26-
- Windows (x64)
24+
- Linux (amd64, arm64)
25+
- macOS (amd64, arm64)
26+
- Windows (amd64)
2727

2828
### Debian/Ubuntu
2929

3030
```bash
3131
# Download the .deb package from releases, then:
32-
sudo dpkg -i certman-amd64.deb
32+
sudo dpkg -i certman-linux-amd64.deb
3333
```
3434

3535
## Quick Start

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@certman/cli",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Create and manage your own Certificate Authority for internal HTTPS - simply, securely, and under your control.",
55
"type": "module",
66
"bin": {

scripts/build-deb.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ PACKAGE_NAME="certman"
99
case "$ARCH" in
1010
x64|amd64)
1111
DEB_ARCH="amd64"
12-
BIN_ARCH="linux-x64"
1312
;;
1413
arm64|aarch64)
1514
DEB_ARCH="arm64"
16-
BIN_ARCH="linux-arm64"
1715
;;
1816
*)
1917
echo "Unsupported architecture: $ARCH"
@@ -30,8 +28,8 @@ echo "Building Debian package for $DEB_ARCH..."
3028
mkdir -p "$PKGDIR/DEBIAN"
3129
mkdir -p "$PKGDIR/usr/bin"
3230

33-
# Copy binary
34-
cp "bin/certman-${BIN_ARCH}" "$PKGDIR/usr/bin/certman"
31+
# Copy binary (uses naming: certman-linux-ARCH)
32+
cp "bin/${PACKAGE_NAME}-linux-${DEB_ARCH}" "$PKGDIR/usr/bin/certman"
3533
chmod 755 "$PKGDIR/usr/bin/certman"
3634

3735
# Create control file
@@ -52,9 +50,9 @@ dpkg-deb --build "$PKGDIR"
5250

5351
# Move to output directory
5452
mkdir -p deb
55-
mv "$WORKDIR/${PACKAGE_NAME}_${VERSION}_${DEB_ARCH}.deb" "deb/"
53+
mv "$WORKDIR/${PACKAGE_NAME}_${VERSION}_${DEB_ARCH}.deb" "deb/${PACKAGE_NAME}-linux-${DEB_ARCH}.deb"
5654

5755
# Cleanup
5856
rm -rf "$WORKDIR"
5957

60-
echo "Created: deb/${PACKAGE_NAME}_${VERSION}_${DEB_ARCH}.deb"
58+
echo "Created: deb/${PACKAGE_NAME}-linux-${DEB_ARCH}.deb"

scripts/update-homebrew.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Certman < Formula
2121
2222
on_macos do
2323
on_arm do
24-
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-darwin-arm64"
24+
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-darwin-arm64.tar.gz"
2525
sha256 "${binaries["darwin-arm64"]}"
2626
2727
def install
@@ -30,18 +30,18 @@ class Certman < Formula
3030
end
3131
3232
on_intel do
33-
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-darwin-x64"
34-
sha256 "${binaries["darwin-x64"]}"
33+
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-darwin-amd64.tar.gz"
34+
sha256 "${binaries["darwin-amd64"]}"
3535
3636
def install
37-
bin.install "certman-darwin-x64" => "certman"
37+
bin.install "certman-darwin-amd64" => "certman"
3838
end
3939
end
4040
end
4141
4242
on_linux do
4343
on_arm do
44-
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-linux-arm64"
44+
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-linux-arm64.tar.gz"
4545
sha256 "${binaries["linux-arm64"]}"
4646
4747
def install
@@ -50,11 +50,11 @@ class Certman < Formula
5050
end
5151
5252
on_intel do
53-
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-linux-x64"
54-
sha256 "${binaries["linux-x64"]}"
53+
url "https://github.com/certman/certman-cli/releases/download/v#{version}/certman-linux-amd64.tar.gz"
54+
sha256 "${binaries["linux-amd64"]}"
5555
5656
def install
57-
bin.install "certman-linux-x64" => "certman"
57+
bin.install "certman-linux-amd64" => "certman"
5858
end
5959
end
6060
end
@@ -77,11 +77,11 @@ function main() {
7777

7878
console.log(`Updating Homebrew formula for version ${version}`);
7979

80-
const targets = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"];
80+
const targets = ["darwin-arm64", "darwin-amd64", "linux-arm64", "linux-amd64"];
8181
const binaries: Record<string, string> = {};
8282

8383
for (const target of targets) {
84-
const artifactName = `certman-${target}`;
84+
const artifactName = `certman-${target}.tar.gz`;
8585
const filePath = `${artifactsDir}/${artifactName}/${artifactName}`;
8686

8787
console.log(`Calculating SHA256 for ${artifactName}...`);

0 commit comments

Comments
 (0)