Update build, enable ZTP #11
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: SONiC Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sonic-vs: | |
name: Build SONiC VS | |
runs-on: self-hosted | |
steps: | |
- name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 | |
run: | | |
[ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install build requirements | |
shell: bash | |
run: | | |
sudo apt install --yes j2cli | |
sudo mkdir -p /var/cache/sonic/artifacts | |
sudo chmod 777 /var/cache/sonic/artifacts | |
- name: build sonic-vs | |
shell: bash | |
run: | | |
git clone --recurse-submodules https://github.com/sonic-net/sonic-buildimage.git | |
cd sonic-buildimage | |
git checkout 202411 | |
make init | |
make configure PLATFORM=vs | |
make SONIC_BUILD_JOBS=8 target/sonic-vs.img.gz | |
ls -l target | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
target/sonic-vs.img.gz | |
if: ${{ github.event_name == 'release' }} | |
sonic-broadcom: | |
name: Build SONiC Broadcom | |
runs-on: self-hosted | |
steps: | |
- name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 | |
run: | | |
[ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install build requirements | |
shell: bash | |
run: | | |
sudo apt install --yes j2cli | |
sudo mkdir -p /var/cache/sonic/artifacts | |
sudo chmod 777 /var/cache/sonic/artifacts | |
- name: build sonic-broadcom | |
shell: bash | |
run: | | |
git clone --recurse-submodules https://github.com/sonic-net/sonic-buildimage.git | |
cd sonic-buildimage | |
git checkout 202411 | |
make init | |
make configure PLATFORM=broadcom | |
make SONIC_BUILD_JOBS=12 ENABLE_ZTP=y target/sonic-broadcom.bin | |
ls -l target | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
target/sonic-broadcom.img.gz | |
if: ${{ github.event_name == 'release' }} | |
release-drafter: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: release-drafter/release-drafter@v6 | |
with: | |
# TODO put branch name here | |
tag: "SONiC-${{ github.run_number }}" | |
version: "SONiC-${{ github.run_number }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name == 'push' }} |