Kernel 6.6.56 #44
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
name: Build | |
on: | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
push: | |
branches: | |
- master | |
env: | |
kernel: "6.6.56" | |
GCS_BUCKET: images.metal-pod.io | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Make tag | |
run: | | |
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TARGET_BINARY_LOCATION=pull_requests/$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true | |
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "TARGET_BINARY_LOCATION=mainline" >> $GITHUB_ENV || true | |
- name: Build | |
run: | | |
docker build --build-arg KERNEL_MAJOR="v6.x" \ | |
--build-arg KERNEL_VERSION=${{ env.kernel }} \ | |
--build-arg KERNEL_SERIES="mainline" \ | |
--tag metal-stack/kernel . | |
docker export $(docker create metal-stack/kernel /dev/null) > kernel.tar | |
tar -xf kernel.tar metal-kernel | |
mv metal-kernel metal-kernel-${{ env.kernel }} | |
md5sum metal-kernel-${{ env.kernel }} > metal-kernel-${{ env.kernel }}.md5 | |
mkdir -p metal-kernel/${TARGET_BINARY_LOCATION} | |
mv metal-kernel-${{ env.kernel }} metal-kernel-${{ env.kernel }}.md5 metal-kernel/${TARGET_BINARY_LOCATION} | |
if: ${{ github.event_name != 'release' }} | |
- name: Upload kernel to GCS | |
run: gsutil -m -h "Cache-Control:no-store" cp -r metal-kernel gs://$GCS_BUCKET | |
if: ${{ github.event_name != 'release' }} | |
- name: Prepare release | |
run: | | |
mkdir -p metal-kernel | |
gsutil -m cp gs://$GCS_BUCKET/metal-kernel/mainline/metal-kernel-${{ env.kernel }} metal-kernel/metal-kernel | |
gsutil -m cp gs://$GCS_BUCKET/metal-kernel/mainline/metal-kernel-${{ env.kernel }}.md5 metal-kernel/metal-kernel.md5 | |
if: ${{ github.event_name == 'release' }} | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
metal-kernel/* | |
if: ${{ github.event_name == 'release' }} | |
release-drafter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: release-drafter/release-drafter@v6 | |
with: | |
tag: "${{ env.kernel }}-${{ github.run_number }}" | |
version: "${{ env.kernel }}-${{ github.run_number }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name == 'push' }} |