Repository navigation
64 lines (64 loc) · 2.26 KB
/
Copy pathrelease_update_readme.yaml
File metadata and controls
64 lines (64 loc) · 2.26 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
---
name: update-readme-on-release
on:
release:
types: [released]
permissions:
contents: read
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
- name: Import GPG key
shell: bash
env:
BUILDBOT_GPG_KEY_B64: ${{ secrets.BUILDBOT_GPG_KEY_B64 }}
BUILDBOT_GPG_KEY_ID: ${{ secrets.BUILDBOT_GPG_KEY_ID }}
run: |
echo "${BUILDBOT_GPG_KEY_B64}" | base64 --decode | gpg --no-tty --batch --import
git config --global user.signingkey "${BUILDBOT_GPG_KEY_ID}"
git config --global commit.gpgsign true
- name: Import SSH key
shell: bash
env:
BUILDBOT_SSH_KEY_B64: ${{ secrets.BUILDBOT_SSH_KEY_B64 }}
run: |
echo "${BUILDBOT_SSH_KEY_B64}" | base64 --decode > /tmp/ssh.key
chmod 600 /tmp/ssh.key
- name: Setup git
shell: bash
env:
GIT_SSH_COMMAND: "ssh -i /tmp/ssh.key"
run: |
git config --global user.name 'pixie-io-buildbot'
git config --global user.email 'build@pixielabs.ai'
git remote add fork git@github.com:pixie-io-buildbot/pixie.git
- name: Update readme locally
shell: bash
env:
TAG_NAME: ${{ github.event.release.tag_name }}
URL: ${{ github.event.release.html_url }}
run: |
export COMPONENT="$(echo "${TAG_NAME}" | cut -d'/' -f2)"
export VERSION="$(echo "${TAG_NAME}" | cut -d'/' -f3)"
./ci/update_files_with_release_versions.sh "${COMPONENT}" "${VERSION}" "${URL}"
- name: Create PR
shell: bash
env:
TAG_NAME: ${{ github.event.release.tag_name }}
GH_TOKEN: ${{ secrets.BUILDBOT_GH_API_TOKEN }}
GIT_SSH_COMMAND: "ssh -i /tmp/ssh.key"
run: |
export VERSION="$(echo "${TAG_NAME}" | cut -d'/' -f3)"
export BRANCH="${VERSION}-update-readme"
git checkout -b "${BRANCH}"
git add README.md
git add k8s/cloud/public/base/artifact_tracker_versions.yaml
git commit -s -m "$(cat pr_title)"
git push -f fork "${BRANCH}"
gh pr create --repo pixie-io/pixie \
--head "pixie-io-buildbot:${BRANCH}" \
--body "$(cat pr_body)" --title "$(cat pr_title)"