mirror of https://github.com/buster-so/buster.git
threw in old workflow with the github tap....
This commit is contained in:
parent
4751cf13f0
commit
256bbbb934
|
@ -12,12 +12,10 @@ on:
|
||||||
# Add permissions for creating releases
|
# Add permissions for creating releases
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write # As per old workflow
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build CLI Binaries
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -25,39 +23,24 @@ jobs:
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
artifact_name: buster-cli-linux-x86_64.tar.gz
|
artifact_name: buster-cli-linux-x86_64.tar.gz
|
||||||
use_tar: true
|
use_tar: true
|
||||||
binary_name: buster-cli
|
|
||||||
rust_flags: ""
|
|
||||||
pkg_config_path: ""
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: x86_64-apple-darwin
|
target: x86_64-apple-darwin
|
||||||
artifact_name: buster-cli-darwin-x86_64.tar.gz
|
artifact_name: buster-cli-darwin-x86_64.tar.gz
|
||||||
use_tar: true
|
use_tar: true
|
||||||
binary_name: buster-cli
|
|
||||||
rust_flags: "-L/usr/local/opt/libpq/lib"
|
|
||||||
pkg_config_path: "/usr/local/opt/libpq/lib/pkgconfig"
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: aarch64-apple-darwin
|
target: aarch64-apple-darwin
|
||||||
artifact_name: buster-cli-darwin-arm64.tar.gz
|
artifact_name: buster-cli-darwin-arm64.tar.gz
|
||||||
use_tar: true
|
use_tar: true
|
||||||
binary_name: buster-cli
|
|
||||||
rust_flags: "-L/opt/homebrew/opt/libpq/lib"
|
|
||||||
pkg_config_path: "/opt/homebrew/opt/libpq/lib/pkgconfig"
|
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
artifact_name: buster-cli-windows-x86_64.zip
|
artifact_name: buster-cli-windows-x86_64.zip
|
||||||
use_tar: false
|
use_tar: false
|
||||||
binary_name: buster-cli.exe
|
runs-on: ${{ matrix.os }}
|
||||||
rust_flags: ""
|
|
||||||
pkg_config_path: ""
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # As per old workflow
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install libpq (macOS)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: brew install libpq
|
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -79,37 +62,29 @@ jobs:
|
||||||
echo 'panic = "abort"' >> .cargo/config.toml
|
echo 'panic = "abort"' >> .cargo/config.toml
|
||||||
echo 'opt-level = 3' >> .cargo/config.toml
|
echo 'opt-level = 3' >> .cargo/config.toml
|
||||||
echo 'strip = true' >> .cargo/config.toml
|
echo 'strip = true' >> .cargo/config.toml
|
||||||
|
|
||||||
- name: Build optimized release
|
- name: Build optimized release
|
||||||
# Builds the buster-cli package from cli/cli/Cargo.toml
|
working-directory: ./cli
|
||||||
working-directory: ./cli
|
run: cargo build --release --target ${{ matrix.target }}
|
||||||
env:
|
|
||||||
RUSTFLAGS: ${{ matrix.rust_flags }}
|
|
||||||
PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }}
|
|
||||||
run: cargo build --release --target ${{ matrix.target }} --manifest-path ./cli/Cargo.toml
|
|
||||||
|
|
||||||
- name: Compress binary (Unix)
|
- name: Compress binary (Unix)
|
||||||
if: matrix.use_tar
|
if: matrix.use_tar
|
||||||
# working-directory: ./cli # Old: This was ./cli
|
working-directory: ./cli
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
cd cli/target/${{ matrix.target }}/release # Adjusted path to be from repo root
|
cd target/${{ matrix.target }}/release
|
||||||
tar czf ${{ matrix.artifact_name }} ${{ matrix.binary_name }}
|
tar czf ${{ matrix.artifact_name }} buster-cli
|
||||||
if [[ "${{ runner.os }}" == "macOS" ]]; then
|
if [[ "${{ runner.os }}" == "macOS" ]]; then
|
||||||
shasum -a 256 ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256
|
shasum -a 256 ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256
|
||||||
else
|
else
|
||||||
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256
|
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Compress binary (Windows)
|
- name: Compress binary (Windows)
|
||||||
if: matrix.use_tar == false
|
if: matrix.use_tar == false
|
||||||
# working-directory: ./cli # Old: This was ./cli
|
working-directory: ./cli
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
cd cli/target/${{ matrix.target }}/release # Adjusted path to be from repo root
|
cd target/${{ matrix.target }}/release
|
||||||
Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ${{ matrix.artifact_name }}
|
Compress-Archive -Path buster-cli.exe -DestinationPath ${{ matrix.artifact_name }}
|
||||||
Get-FileHash -Algorithm SHA256 ${{ matrix.artifact_name }} | Select-Object -ExpandProperty Hash > ${{ matrix.artifact_name }}.sha256
|
Get-FileHash -Algorithm SHA256 ${{ matrix.artifact_name }} | Select-Object -ExpandProperty Hash > ${{ matrix.artifact_name }}.sha256
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -120,58 +95,42 @@ jobs:
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create GitHub Release for CLI
|
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
cli_version: ${{ steps.get_version.outputs.version }}
|
|
||||||
cli_tag_name: v${{ steps.get_version.outputs.version }} # Matches old tag format
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Download all build artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
|
||||||
path: downloaded-artifacts # Download all artifacts to this directory
|
|
||||||
|
|
||||||
- name: List downloaded artifacts (for debugging)
|
|
||||||
run: ls -R downloaded-artifacts
|
|
||||||
|
|
||||||
- name: Extract version from cli/cli/Cargo.toml
|
- name: Extract version from Cargo.toml
|
||||||
id: get_version
|
id: get_version
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
# Correctly extract from the package manifest, not the workspace
|
VERSION=$(grep '^version =' cli/Cargo.toml | sed 's/version = "\(.*\)"/\1/')
|
||||||
VERSION=$(grep '^version' cli/cli/Cargo.toml | head -n 1 | sed 's/version = "\(.*\)"/\1/')
|
|
||||||
if [ -z "$VERSION" ]; then
|
|
||||||
echo "Error: Could not determine CLI version from cli/cli/Cargo.toml."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Extracted version: $VERSION"
|
echo "Extracted version: $VERSION"
|
||||||
|
- name: Create Release
|
||||||
- name: Create GitHub Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ steps.get_version.outputs.version }} # Uses version from cli/cli/Cargo.toml
|
tag_name: v${{ steps.get_version.outputs.version }}
|
||||||
name: CLI Release v${{ steps.get_version.outputs.version }}
|
name: Release v${{ steps.get_version.outputs.version }}
|
||||||
files: |
|
files: |
|
||||||
downloaded-artifacts/**/buster-cli-linux-x86_64.tar.gz
|
**/buster-cli-linux-x86_64.tar.gz
|
||||||
downloaded-artifacts/**/buster-cli-linux-x86_64.tar.gz.sha256
|
**/buster-cli-linux-x86_64.tar.gz.sha256
|
||||||
downloaded-artifacts/**/buster-cli-darwin-x86_64.tar.gz
|
**/buster-cli-darwin-x86_64.tar.gz
|
||||||
downloaded-artifacts/**/buster-cli-darwin-x86_64.tar.gz.sha256
|
**/buster-cli-darwin-x86_64.tar.gz.sha256
|
||||||
downloaded-artifacts/**/buster-cli-darwin-arm64.tar.gz
|
**/buster-cli-darwin-arm64.tar.gz
|
||||||
downloaded-artifacts/**/buster-cli-darwin-arm64.tar.gz.sha256
|
**/buster-cli-darwin-arm64.tar.gz.sha256
|
||||||
downloaded-artifacts/**/buster-cli-windows-x86_64.zip
|
**/buster-cli-windows-x86_64.zip
|
||||||
downloaded-artifacts/**/buster-cli-windows-x86_64.zip.sha256
|
**/buster-cli-windows-x86_64.zip.sha256
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
update_homebrew_tap:
|
update_homebrew_tap:
|
||||||
name: Update Homebrew Tap
|
name: Update Homebrew Tap
|
||||||
|
|
Loading…
Reference in New Issue