Skip to content

Commit

Permalink
WIP: publish kentik agent package
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Sep 4, 2024
1 parent dc5fe64 commit cab4b88
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/package.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default async function script({github, context, core, io, exec}) {
let target = process.env.TARGET;
let version = process.env.VERSION;

let [arch, , os] = target.split('-');
let [, name] = github.repository.split('/');
let artifact = `${name}-${target}`;

switch (arch) {
case 'aarch64':
arch = 'arm64';
break;
case 'x86_64':
arch = 'amd64';
break;
}

let bundle = `${name}_${version}_${os}_${arch}.tgz`;
let prefix = `${name}-${version}`;

let dir = `${prefix}/bin`;
await io.mkdirP(dir);
await io.cp(artifact, `${dir}/${name}`);

await exec.exec(`tar -czvf ${bundle} ${prefix}`);

core.setOutput('bundle', bundle);
}
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: publish

on:
workflow_dispatch:
push:
branches: publish-kentik-package

jobs:
package:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- armv7-unknown-linux-musleabihf
steps:
- run: |
touch kprobe-${{ matrix.target }}
- uses: actions/github-script@v7
with:
script: |
const script = require('./package.mjs')
await script({github, context, core})
env:
TARGET: ${{ matrix.target }}
VERSION: v2.5.0-rc1
id: package
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.bundle }}
path: ${{ steps.package.outputs.bundle }}


# publish:
# runs-on: ubuntu-latest
# continue-on-error: true
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# # - uses: actions/create-github-app-token@v1
# # id: token
# # with:
# # app-id: ${{ vars.KENTIK_MACHINERY_APP_ID }}
# # private-key: ${{ secrets.KENTIK_MACHINERY_PRIVATE_KEY }}
# # owner: ${{ github.repository_owner }}

0 comments on commit cab4b88

Please sign in to comment.