-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Will
committed
Sep 4, 2024
1 parent
dc5fe64
commit cab4b88
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |