Skip to content

Log DataKey and memory paging totals to buck2_page_outs #13725

Log DataKey and memory paging totals to buck2_page_outs

Log DataKey and memory paging totals to buck2_page_outs #13725

Workflow file for this run

name: Build, upload, and tag `buck2`
on:
push:
branches:
- main
jobs:
set_version_info:
name: Define the version info for this release
runs-on: ubuntu-latest
outputs:
buck2_version: ${{ steps.define_version_info.outputs.buck2_version }}
steps:
- name: Define version info
id: define_version_info
run: |
# Specify the release version information
commit_date=$(echo "${{ github.event.repository.updated_at }}" | sed 's/T.*//')
echo "buck2_version=$commit_date-${{ github.sha }}" >> "$GITHUB_OUTPUT"
- name: Display version info
run: echo ${{ steps.define_version_info.outputs.buck2_version }}
build:
name: Build `buck2`
needs:
- set_version_info
uses: ./.github/workflows/build_buck2.yml
with:
buck2_version: ${{ needs.set_version_info.outputs.buck2_version }}
release_timestamp: ${{ github.event.repository.updated_at }}
release_latest:
name: Release `latest` tag
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# Publish a new tag and upload all aritfacts from `build` and `get_prelude_hash`
- uses: ./.github/actions/publish_tag
with:
tag: "latest"
github_token: ${{ secrets.GITHUB_TOKEN }}
check_for_bi_monthly_release:
name: Check if there's a release for this half of the month already
runs-on: ubuntu-latest
needs:
- build
outputs:
tag: ${{ steps.check_if_we_need_to_tag.outputs.new_tag }}
steps:
- id: get_date
name: Store date information so we stay consistent between the steps
run: |
month=$(date +%Y-%m)
# The math below uses the day number "XX" as a number, but if it has a leading 0 and the
# second digit is larger than 7 this fails as it parses as an octal, so we use `sed` to fix:
day=$(date +%d | sed 's/^0*//')
tag=$(date +%Y-%m-%d)
echo "month=$month" >> "$GITHUB_OUTPUT"
echo "day=$day" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
- id: get_tags_count
name: Count the number of tags already published for this month
run: |
# GITHUB_REPOSITORY is used to allow this action to work on forks
url="https://api.github.com/repos/$GITHUB_REPOSITORY/tags"
curl --retry 5 -fsSL "$url" -o tags.txt
tags=$(cat tags.txt | jq -r ".[].name")
# Anchor the match so manual timestamped releases (YYYY-MM-DD-HH.MM.SS) don't count
tags_count=$(echo "$tags" | grep -c "^${{ steps.get_date.outputs.month }}-[0-9][0-9]$" || true)
echo "tags_count=$tags_count" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
- id: check_if_we_need_to_tag
name: Check if we should tag
run: |
tags_count=${{ steps.get_tags_count.outputs.tags_count }}
day=${{ steps.get_date.outputs.day }}
tag=${{ steps.get_date.outputs.tag }}
# If we're in the first half of the month, check if there are no tags for this month yet
if (( day < 15 && tags_count < 1 )); then echo "new_tag=${tag}" >> "$GITHUB_OUTPUT"; fi;
# Otherwise, tag if the count is less than 2.
if (( day >= 15 && tags_count < 2 )); then echo "new_tag=${tag}" >> "$GITHUB_OUTPUT"; fi;
cat $GITHUB_OUTPUT
release_bi_monthly:
name: Release bi-monthly tag
needs:
- build
- check_for_bi_monthly_release
runs-on: ubuntu-latest
# Only perform this action if check_for_bi_monthly_release set a tag output
if: ${{ needs.check_for_bi_monthly_release.outputs.tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# Publish a new tag and upload all aritfacts from `build` and `get_prelude_hash`
- uses: ./.github/actions/publish_tag
with:
tag: ${{ needs.check_for_bi_monthly_release.outputs.tag }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: facebook/dotslash-publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config: .github/dotslash-config.json
tag: ${{ needs.check_for_bi_monthly_release.outputs.tag }}
build_docs_job:
name: Publish buck2.build
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download Buck2
uses: actions/download-artifact@v7
with:
name: buck2-x86_64-unknown-linux-gnu
path: artifacts
- name: Decompress Buck2
run: |
zstd -d artifacts/buck2-x86_64-unknown-linux-gnu.zst -o artifacts/buck2-release
chmod +x artifacts/buck2-release
- name: Install dependencies
run: |
sudo apt-get install -y yarn
id: build
- name: Build the Website
run: |
cd website
yarn
BUCK2_BIN="$GITHUB_WORKSPACE/artifacts/buck2-release" yarn build_prebuilt
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: website/build # The folder the action should deploy.
single-commit: true # Discard history for the gh-pages branch.