Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
83 changes: 33 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,11 @@ name: Build Binaries
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
name: Build Cross-Platform Binaries
name: Build All Platforms
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Linux builds
- goos: linux
goarch: amd64
name: jail-linux-amd64
- goos: linux
goarch: arm64
name: jail-linux-arm64
# macOS builds
- goos: darwin
goarch: amd64
name: jail-darwin-amd64
- goos: darwin
goarch: arm64
name: jail-darwin-arm64

steps:
- name: Check out code
Expand All @@ -48,33 +29,38 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download
- name: Download and verify dependencies
run: make deps

- name: Verify dependencies
run: go mod verify
- name: Build all platforms
run: make build-all

- name: Build binary
run: |
# Set target for cross-compilation
export GOOS=${{ matrix.goos }}
export GOARCH=${{ matrix.goarch }}
export CGO_ENABLED=0

# Add version info if available
VERSION="dev-${{ github.sha }}"
if [ "${{ github.ref_type }}" = "tag" ]; then
VERSION="${{ github.ref_name }}"
fi

# Build using Go directly for cross-compilation
go build -ldflags="-s -w -X main.version=$VERSION" -o ${{ matrix.name }} ./cmd/jail
- name: Upload Linux x64 binary
uses: actions/upload-artifact@v4
with:
name: boundary-linux-amd64
path: build/boundary-linux-amd64
retention-days: 30

- name: Upload Linux ARM64 binary
uses: actions/upload-artifact@v4
with:
name: boundary-linux-arm64
path: build/boundary-linux-arm64
retention-days: 30

- name: Upload macOS Intel binary
uses: actions/upload-artifact@v4
with:
name: boundary-darwin-amd64
path: build/boundary-darwin-amd64
retention-days: 30

- name: Upload binary as artifact
- name: Upload macOS Apple Silicon binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}
name: boundary-darwin-arm64
path: build/boundary-darwin-arm64
retention-days: 30

summary:
Expand All @@ -92,14 +78,11 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📦 Available Binaries" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- 🐧 **Linux (x64)**: jail-linux-amd64" >> $GITHUB_STEP_SUMMARY
echo "- 🐧 **Linux (ARM64)**: jail-linux-arm64" >> $GITHUB_STEP_SUMMARY
echo "- 🍎 **macOS (Intel)**: jail-darwin-amd64" >> $GITHUB_STEP_SUMMARY
echo "- 🍎 **macOS (Apple Silicon)**: jail-darwin-arm64" >> $GITHUB_STEP_SUMMARY
echo "- 🐧 **Linux (x64)**: boundary-linux-amd64" >> $GITHUB_STEP_SUMMARY
echo "- 🐧 **Linux (ARM64)**: boundary-linux-arm64" >> $GITHUB_STEP_SUMMARY
echo "- 🍎 **macOS (Intel)**: boundary-darwin-amd64" >> $GITHUB_STEP_SUMMARY
echo "- 🍎 **macOS (Apple Silicon)**: boundary-darwin-arm64" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📎 Download Instructions" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "1. Go to the **Actions** tab" >> $GITHUB_STEP_SUMMARY
echo "2. Click on this workflow run" >> $GITHUB_STEP_SUMMARY
echo "3. Scroll down to **Artifacts** section" >> $GITHUB_STEP_SUMMARY
echo "4. Download the binary for your platform" >> $GITHUB_STEP_SUMMARY
echo "Artifacts can be downloaded from the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." >> $GITHUB_STEP_SUMMARY
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify
- name: Download and verify dependencies
run: make deps

- name: Run tests
run: make test
Expand Down
114 changes: 42 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,8 @@ on:

jobs:
build:
name: Build Binaries
name: Build All Platforms
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Linux builds
- goos: linux
goarch: amd64
name: jail-linux-amd64
- goos: linux
goarch: arm64
name: jail-linux-arm64
# macOS builds
- goos: darwin
goarch: amd64
name: jail-darwin-amd64
- goos: darwin
goarch: arm64
name: jail-darwin-arm64

steps:
- name: Check out code
Expand All @@ -48,27 +31,38 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download
- name: Download and verify dependencies
run: make deps

- name: Verify dependencies
run: go mod verify
- name: Build all platforms
run: make build-all

- name: Build binary
run: |
# Set target for cross-compilation
export GOOS=${{ matrix.goos }}
export GOARCH=${{ matrix.goarch }}
export CGO_ENABLED=0

# Build using Go directly for cross-compilation
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o ${{ matrix.name }} ./cmd/jail
- name: Upload Linux x64 binary
uses: actions/upload-artifact@v4
with:
name: boundary-linux-amd64
path: build/boundary-linux-amd64
retention-days: 7

- name: Upload Linux ARM64 binary
uses: actions/upload-artifact@v4
with:
name: boundary-linux-arm64
path: build/boundary-linux-arm64
retention-days: 7

- name: Upload macOS Intel binary
uses: actions/upload-artifact@v4
with:
name: boundary-darwin-amd64
path: build/boundary-darwin-amd64
retention-days: 7

- name: Upload binary as artifact
- name: Upload macOS Apple Silicon binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}
name: boundary-darwin-arm64
path: build/boundary-darwin-arm64
retention-days: 7

release:
Expand All @@ -81,55 +75,31 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
check-latest: true

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./binaries

- name: Prepare release assets
run: |
cd binaries
# Create compressed archives for each binary
for dir in */; do
binary_name=$(basename "$dir")
cd "$dir"
# Unix: create tar.gz
tar -czf "../${binary_name}.tar.gz" "$binary_name"
cd ..
done
# Create archives directly from artifacts using make target
make release-archives

# List all release assets
ls -la *.tar.gz

- name: Generate release notes
id: release_notes
run: |
echo "## 🚀 Release ${{ github.ref_name }}" > release_notes.md
echo "" >> release_notes.md
echo "### 📦 Downloads" >> release_notes.md
echo "" >> release_notes.md
echo "Choose the appropriate binary for your platform:" >> release_notes.md
echo "" >> release_notes.md
echo "- **Linux (x64)**: \`jail-linux-amd64.tar.gz\`" >> release_notes.md
echo "- **Linux (ARM64)**: \`jail-linux-arm64.tar.gz\`" >> release_notes.md
echo "- **macOS (Intel)**: \`jail-darwin-amd64.tar.gz\`" >> release_notes.md
echo "- **macOS (Apple Silicon)**: \`jail-darwin-arm64.tar.gz\`" >> release_notes.md
echo "" >> release_notes.md
echo "### 🛠️ Installation" >> release_notes.md
echo "" >> release_notes.md
echo "1. Download the appropriate binary for your platform" >> release_notes.md
echo "2. Extract the archive" >> release_notes.md
echo "3. Make the binary executable (Unix): `chmod +x jail`" >> release_notes.md
echo "4. Move to your PATH: `sudo mv jail /usr/local/bin/` (Unix)" >> release_notes.md
echo "" >> release_notes.md
echo "### ✅ Verification" >> release_notes.md
echo "" >> release_notes.md
echo "Verify installation: `jail --help`" >> release_notes.md
ls -la archives/*.tar.gz

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
binaries/*.tar.gz
body_path: release_notes.md
files: 'archives/*.tar.gz'
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 0 additions & 50 deletions .gitignore

This file was deleted.

Loading
Loading