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
75 changes: 67 additions & 8 deletions .github/workflows/build.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OSQuery Build and Push Latest
name: OSQuery Release

permissions:
contents: write
Expand All @@ -13,11 +13,10 @@ on:
branches: [master]
paths-ignore:
- "**/*.md"
- '.github/**'
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g., v1.2.3)"
version:
description: "Version to Release (e.g., v1.2.3)"
required: true
type: string

Expand All @@ -38,7 +37,8 @@ jobs:
name: "Build C Client for (${{ matrix.os }} ${{ matrix.os_arch }})"
runs-on: ${{ matrix.os }}
if: |
github.event_name == 'push' || github.event_name == 'workflow_dispatch'
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
defaults:
run:
shell: bash
Expand Down Expand Up @@ -151,6 +151,7 @@ jobs:
retention-days: 30
compression-level: 9


create_universal_macos:
name: "Create Universal macOS Binary"
needs: [build_macos]
Expand Down Expand Up @@ -206,16 +207,18 @@ jobs:
- name: Upload Universal Binary
uses: actions/upload-artifact@v4
with:
name: osquery-macos-universal
name: osquery-mac-universal
path: artifacts/
retention-days: 30
compression-level: 9


build_windows:
name: "Build C Client for (${{ matrix.os }} ${{ matrix.os_arch }})"
runs-on: ${{ matrix.os }}
if: |
github.event_name == 'push' || github.event_name == 'workflow_dispatch'
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
defaults:
run:
shell: cmd
Expand All @@ -226,7 +229,7 @@ jobs:
- name: "Windows x64"
os: windows-latest
os_arch: x64
artifact_name: osquery-windows-x64
artifact_name: osquery-windows-amd64

steps:
- name: Checkout
Expand Down Expand Up @@ -262,3 +265,59 @@ jobs:
if-no-files-found: warn
retention-days: 30
compression-level: 9


release:
name: "Create Release"
needs: [build_macos, create_universal_macos, build_windows]
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' &&
inputs.version != ''
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
continue-on-error: true

- name: Prepare release artifacts
run: |
set -e
mkdir -p final-artifacts/clients

# macOS
if [ -d "release-artifacts/osquery-mac-universal" ]; then
tar -czf "final-artifacts/clients/osquery-macos-universal.tar.gz" \
-C "release-artifacts/osquery-mac-universal" ${{ env.BINARY_NAME }}
fi
# Windows
if [ -d "release-artifacts/osquery-windows-amd64" ]; then
(cd "release-artifacts/osquery-windows-amd64" && \
zip "${GITHUB_WORKSPACE}/final-artifacts/clients/osquery-windows-amd64.zip" ${{ env.BINARY_NAME }}.exe)
fi

ls -lh final-artifacts/clients/

- name: Generate release header
run: |
cat > RELEASE_HEADER.md <<EOF
## OSQuery Clients
- **macOS** (Universal): \`osquery-macos-universal.tar.gz\`
- **Windows** (amd64): \`osquery-windows-amd64.zip\`
EOF

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.version }}
name: "🦩 ${{ inputs.version }}"
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
body_path: RELEASE_HEADER.md
files: |
final-artifacts/clients/*
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OSQuery Integration Tests
name: OSQuery Test

permissions:
contents: write
Expand Down
Loading