diff --git a/.github/workflows/glibcs.yml b/.github/workflows/glibcs.yml index 5b74c3b..e730e70 100644 --- a/.github/workflows/glibcs.yml +++ b/.github/workflows/glibcs.yml @@ -17,11 +17,23 @@ jobs: - name: Checkout run: | python arch/${{matrix.arch}}/build-${{matrix.arch}}.py --shallow arch/${{matrix.arch}} checkout + - name: Store Global Version Json + run: | + cd arch/${{matrix.arch}}/src + echo "GLABAL_VERSION_JSON=$(jq -c . < versions.json)" >> $GITHUB_ENV + - name: Store Glibc Version + # 在arch/${{matrix.arch}}/src/glibc下,读取version.h中的版本值 + run: | + cd arch/${{matrix.arch}}/src/glibc && + glibc_version=$(grep 'VERSION' version.h | awk '{print $3}' | sed 's/"//g') && + echo "GLIBC_VERSION=${glibc_version}" >> $GITHUB_ENV - name: Debug run: | cd arch/${{matrix.arch}}/src && ls -ahl && - cat versions.json + cat versions.json && + echo '${{ fromJson(env.GLABAL_VERSION_JSON).glibc.version }}' && + echo ${{env.GLIBC_VERSION}} - name: Build Host-libraries run: | python arch/${{matrix.arch}}/build-${{matrix.arch}}.py -j $(nproc) arch/${{matrix.arch}} host-libraries @@ -53,27 +65,27 @@ jobs: name: glibcs-${{matrix.arch}} path: | arch/${{matrix.arch}}/release/glibcs - # release: - # if: startsWith(github.ref, 'refs/tags/v') - # needs: [meta, build] - # runs-on: ubuntu-latest - # steps: - # - name: Download glibc from Github - # uses: actions/download-artifact@v4 - # with: - # path: assets + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Download glibc from Github + uses: actions/download-artifact@v4 + with: + path: assets - # - name: Cleanup files - # run: | - # mv -vf assets/changelog/* . - # cd assets - # find . -type f | while read f; do mv -fvt . $f; done + - name: Cleanup files + run: | + mv -vf assets/changelog/* . + cd assets + find . -type f | while read f; do mv -fvt . $f; done - # - name: Release to Github - # uses: softprops/action-gh-release@v1 - # with: - # body_path: CHANGELOG.md - # files: | - # assets/* - # prerelease: ${{ needs.meta.outputs.prerelease != 'false' }} + - name: Release to Github + uses: softprops/action-gh-release@v1 + with: + body_path: CHANGELOG.md + files: | + assets/* + prerelease: ${{ needs.meta.outputs.prerelease != 'false' }}