Skip to content

feat: release

feat: release #8

Workflow file for this run

name: build-glibcs
# on: [push,pull_request]
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64-gnu,x86_64-linux-gnu,riscv64imac,riscv64gc-lp64,riscv64gc-lp64d,aarch64]
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
bash ./install_deps.sh
- 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 &&
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
- name: Build Cross-compilers
run: |
python arch/${{matrix.arch}}/build-${{matrix.arch}}.py -j $(nproc) arch/${{matrix.arch}} compilers
# - name: Tar Compilers
# run: |
# mkdir -p arch/${{matrix.arch}}/release/compilers
# cd arch/${{matrix.arch}}/install/compilers
# find . -type d -mindepth 1 -maxdepth 1 -exec tar czvf ${GITHUB_WORKSPACE}/arch/${{matrix.arch}}/release/compilers/{}.tar.gz {} \;
# - name: Upload Compilers
# uses: actions/upload-artifact@v4
# with:
# name: compilers-${{matrix.arch}}
# path: |
# arch/${{matrix.arch}}/release/compilers
- name: Build glibcs
run: |
python arch/${{matrix.arch}}/build-${{matrix.arch}}.py -j $(nproc) arch/${{matrix.arch}} glibcs
- name: Tar glibcs
run: |
mkdir -p arch/${{matrix.arch}}/release/glibcs
cd arch/${{matrix.arch}}/install/glibcs
find . -type d -mindepth 1 -maxdepth 1 -exec tar czvf ${GITHUB_WORKSPACE}/arch/${{matrix.arch}}/release/glibcs/glibc-${{env.GLIBC_VERSION}}-{}.tar.gz {} \;
- name: Upload glibcs
uses: actions/upload-artifact@v4
with:
name: glibcs-${{matrix.arch}}
path: |
arch/${{matrix.arch}}/release/glibcs
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: |
cd assets
find . -type f | while read f; do mv -fvt . $f; done
- name: Release to Github
uses: softprops/action-gh-release@v1
with:
files: |
assets/*