|
27 | 27 | tests/quake/** |
28 | 28 | tests/scimark2/** |
29 | 29 | tests/*.c |
30 | | - - name: Test file change of Linux image |
31 | | - id: test-linux-image-version-change |
32 | | - uses: tj-actions/changed-files@v45 |
33 | | - with: |
34 | | - files: | |
35 | | - mk/external.mk |
36 | 30 | - name: Set alias |
37 | 31 | id: has_changed_files |
38 | 32 | run: | |
|
41 | 35 | else |
42 | 36 | echo "has_changed_files=false" >> $GITHUB_OUTPUT |
43 | 37 | fi |
44 | | - if [[ ${{ steps.test-linux-image-version-change.outputs.any_modified }} == true ]]; then |
45 | | - # 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) |
46 | | - echo -n $(git --no-pager diff HEAD^ HEAD | grep -e "+BUILDROOT_VERSION" -e "+LINUX_VERSION" -e "+LINUX_DATA_SHA1") >> linux-image-version-change |
47 | | - if [[ -s linux-image-version-change ]]; then |
48 | | - echo "has_changed_linux_image_version=true" >> $GITHUB_OUTPUT |
49 | | - else |
50 | | - echo "has_changed_linux_image_version=false" >> $GITHUB_OUTPUT |
51 | | - fi |
52 | | - else |
53 | | - echo "has_changed_linux_image_version=false" >> $GITHUB_OUTPUT |
54 | | - fi |
55 | 38 | outputs: |
56 | 39 | has_changed_files: ${{ steps.has_changed_files.outputs.has_changed_files }} |
57 | | - has_changed_linux_image_version: ${{ steps.has_changed_files.outputs.has_changed_linux_image_version }} |
58 | | - |
59 | | - build-linux-image-artifact: |
60 | | - needs: [detect-file-change] |
61 | | - if: ${{ needs.detect-file-change.outputs.has_changed_linux_image_version == 'true' || github.event_name == 'workflow_dispatch' }} |
62 | | - runs-on: ubuntu-22.04 |
63 | | - steps: |
64 | | - - name: Checkout repository |
65 | | - uses: actions/checkout@v4 |
66 | | - with: |
67 | | - submodules: 'true' |
68 | | - - name: Install dependencies |
69 | | - run: | |
70 | | - sudo apt-get update -q=2 |
71 | | - sudo apt-get upgrade -q=2 |
72 | | - sudo apt-get install -q=2 build-essential git |
73 | | - - name: Build Linux image |
74 | | - run: | |
75 | | - make build-linux-image |
76 | | - make artifact ENABLE_PREBUILT=0 ENABLE_SYSTEM=1 |
77 | | - mkdir -p /tmp/rv32emu-linux-image-prebuilt/linux-image |
78 | | - mv build/linux-image/Image /tmp/rv32emu-linux-image-prebuilt/linux-image |
79 | | - mv build/linux-image/rootfs.cpio /tmp/rv32emu-linux-image-prebuilt/linux-image |
80 | | - mv build/sha1sum-linux-image /tmp |
81 | | - - name: Create tarball |
82 | | - run: | |
83 | | - cd /tmp |
84 | | - tar -zcvf rv32emu-linux-image-prebuilt.tar.gz rv32emu-linux-image-prebuilt |
85 | | - - name: Create GitHub Release |
86 | | - env: |
87 | | - GH_TOKEN: ${{ secrets.RV32EMU_PREBUILT_TOKEN }} |
88 | | - run: | |
89 | | - RELEASE_TAG=$(date +'%Y.%m.%d'-Linux-Image) |
90 | | - cd /tmp |
91 | | - gh release create $RELEASE_TAG \ |
92 | | - --repo sysprog21/rv32emu-prebuilt \ |
93 | | - --title "$RELEASE_TAG""-nightly" |
94 | | - gh release upload $RELEASE_TAG \ |
95 | | - rv32emu-linux-image-prebuilt.tar.gz \ |
96 | | - sha1sum-linux-image \ |
97 | | - --repo sysprog21/rv32emu-prebuilt |
98 | 40 |
|
99 | 41 | build-artifact: |
100 | 42 | needs: [detect-file-change] |
|
0 commit comments