Skip to content

Commit

Permalink
Merge pull request #54 from macadmins/gzip
Browse files Browse the repository at this point in the history
Gzip requests and no longer hard code version
  • Loading branch information
grahamgilbert authored Jul 12, 2024
2 parents 05bb974 + 17e9000 commit b8bf3ee
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 1,622 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build_macadmins_extension.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Build MacAdmins OSQuery Extension (Manual)

env:
VERSION: 1.1.2 # hardcoded for now until we figure out how we want to tackle this

on: [workflow_dispatch]

jobs:
Expand All @@ -19,6 +16,11 @@ jobs:
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
with:
fetch-depth: 0

- name: Read version from VERSION file
run: |
VERSION=$(cat VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Read version from VERSION file
run: |
VERSION=$(cat VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: print version
run: echo ${{ env.VERSION }}

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ macadmins_extension
*.zip
config.mk
bazel-*
coverage/*
coverage/*
version_config.go
30 changes: 17 additions & 13 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ gazelle(
command = "update-repos",
)

genrule(
name = "version_config",
srcs = [
"VERSION",
"write_version_config.sh",
], # Ensure dependencies are listed
outs = ["version_config.go"],
cmd = "$(location write_version_config.sh) $@",
stamp = 1,
tools = ["write_version_config.sh"],
)

go_library(
name = "osquery-extension_lib",
srcs = ["main.go"],
# keep
srcs = [
"main.go",
":version_config",
],
importpath = "github.com/macadmins/osquery-extension",
visibility = ["//visibility:private"],
deps = [
Expand Down Expand Up @@ -87,15 +103,3 @@ go_binary(
goos = "linux",
visibility = ["//visibility:public"],
)

# pkg_zip(
# name = "foo_zip",
# srcs = [
# "README.txt",
# ":manpages",
# ":share_doc",
# "//resources/l10n:all",
# "//src/client:arch",
# "//src/server:arch",
# ],
# )
Loading

0 comments on commit b8bf3ee

Please sign in to comment.