-
Notifications
You must be signed in to change notification settings - Fork 113
Eliminate Linux SUBLEVEL bump and decouple Linux image build CI #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Build Linux artifact | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
detect-file-change: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Test file change of Linux image | ||
id: test-linux-image-version-change | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
files: | | ||
mk/external.mk | ||
- name: Set alias | ||
id: has_changed_files | ||
run: | | ||
if [[ ${{ steps.test-linux-image-version-change.outputs.any_modified }} == true ]]; then | ||
# Determine if the changes are from Buildroot or the Linux version (The Linux might have several patches, so also need to check the SHA value) | ||
echo -n $(git --no-pager diff HEAD^ HEAD | grep -e "+BUILDROOT_VERSION" -e "+LINUX_VERSION" -e "+LINUX_PATCHLEVEL") >> linux-image-version-change | ||
if [[ -s linux-image-version-change ]]; then | ||
echo "has_changed_linux_image_version=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "has_changed_linux_image_version=false" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "has_changed_linux_image_version=false" >> $GITHUB_OUTPUT | ||
fi | ||
outputs: | ||
has_changed_linux_image_version: ${{ steps.has_changed_files.outputs.has_changed_linux_image_version }} | ||
|
||
build-linux-image-artifact: | ||
needs: [detect-file-change] | ||
if: ${{ needs.detect-file-change.outputs.has_changed_linux_image_version == 'true' || github.event_name == 'workflow_dispatch' }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -q=2 | ||
sudo apt-get upgrade -q=2 | ||
sudo apt-get install -q=2 build-essential git | ||
- name: Build Linux image | ||
run: | | ||
make build-linux-image | ||
make artifact ENABLE_PREBUILT=0 ENABLE_SYSTEM=1 | ||
mkdir -p /tmp/rv32emu-linux-image-prebuilt/linux-image | ||
mv build/linux-image/Image /tmp/rv32emu-linux-image-prebuilt/linux-image | ||
mv build/linux-image/rootfs.cpio /tmp/rv32emu-linux-image-prebuilt/linux-image | ||
mv build/sha1sum-linux-image /tmp | ||
- name: Create tarball | ||
run: | | ||
cd /tmp | ||
tar -zcvf rv32emu-linux-image-prebuilt.tar.gz rv32emu-linux-image-prebuilt | ||
- name: Create GitHub Release | ||
env: | ||
GH_TOKEN: ${{ secrets.RV32EMU_PREBUILT_TOKEN }} | ||
run: | | ||
RELEASE_TAG=$(date +'%Y.%m.%d'-Linux-Image) | ||
cd /tmp | ||
gh release create $RELEASE_TAG \ | ||
--repo sysprog21/rv32emu-prebuilt \ | ||
--title "$RELEASE_TAG""-nightly" | ||
gh release upload $RELEASE_TAG \ | ||
rv32emu-linux-image-prebuilt.tar.gz \ | ||
sha1sum-linux-image \ | ||
--repo sysprog21/rv32emu-prebuilt |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.