-
Notifications
You must be signed in to change notification settings - Fork 495
83 lines (82 loc) · 2.71 KB
/
update_script_bundle.yaml
File metadata and controls
83 lines (82 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: update-script-bundle
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build-script-bundle:
name: Build Script Bundle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Add pwd to git safe dir
run: git config --global --add safe.directory `pwd`
- name: Install Pixie CLI
run: |
jq_script=(
'.[] | '
'select(.name == "cli") | '
'.artifact | '
'map(select(.versionStr | contains("-") | not))[0] | '
'.availableArtifactMirrors[] | '
'select(.artifactType == "AT_LINUX_AMD64") | '
'.urls[0]'
)
download_link=$(curl -fssL "https://artifacts.px.dev/artifacts/manifest.json" | jq "${jq_script[*]}" -r )
curl -fssL "${download_link}" -o px
chmod +x px
- name: Build bundle
shell: bash
run: |
export PATH="$PATH:$(pwd)"
cd src/pxl_scripts
make bundle-oss.json
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: bundle
path: src/pxl_scripts/bundle-oss.json
update-gh-pages-bundle:
name: Update bundle in gh-pages
runs-on: ubuntu-latest
needs: build-script-bundle
concurrency: gh-pages
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: gh-pages
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
- name: Import GPG key
env:
BUILDBOT_GPG_KEY_B64: ${{ secrets.BUILDBOT_GPG_KEY_B64 }}
run: |
echo "${BUILDBOT_GPG_KEY_B64}" | base64 --decode | gpg --no-tty --batch --import
- name: Setup git
shell: bash
env:
BUILDBOT_GPG_KEY_ID: ${{ secrets.BUILDBOT_GPG_KEY_ID }}
run: |
git config --global user.name 'pixie-io-buildbot'
git config --global user.email 'build@pixielabs.ai'
git config --global user.signingkey "${BUILDBOT_GPG_KEY_ID}"
git config --global commit.gpgsign true
- name: Push to gh-pages
shell: bash
env:
GH_TOKEN: ${{ secrets.BUILDBOT_GH_API_TOKEN }}
GIT_SSH_COMMAND: "ssh -i /tmp/ssh.key"
run: |
mkdir -p pxl_scripts
cp bundle/bundle-oss.json pxl_scripts/bundle.json
git add pxl_scripts/bundle.json
if [[ $(git status --porcelain=v1 --untracked-files=no | wc -l) -eq 0 ]]; then
echo "No updates to script bundle, exiting."
exit 0
fi
git commit -s -m "Update PxL script bundle"
git push origin "gh-pages"