Skip to content

edit config.mak

edit config.mak #37

Workflow file for this run

name: musl-cross-builder
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: download musl-cross-make
run: wget -qO musl-cross-make.tar.gz https://git.zv.io/toolchains/musl-cross-make/-/archive/musl.cc-old/musl-cross-make-musl.cc-old.tar.gz
- name: "Upload Artifact"
uses: actions/upload-artifact@v3
id: upload
with:
name: musl-cross-make
path: musl-cross-make.tar.gz
build:
needs: download
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
os: [ubuntu2204]
arch_type:
[
aarch64-linux-musl,
aarch64_be-linux-musl,
arm-linux-musleabi,
arm-linux-musleabihf,
armeb-linux-musleabi,
armeb-linux-musleabihf,
armel-linux-musleabi,
armel-linux-musleabihf,
armv5l-linux-musleabi,
armv5l-linux-musleabihf,
armv6-linux-musleabi,
armv6-linux-musleabihf,
armv7l-linux-musleabihf,
armv7m-linux-musleabi,
armv7r-linux-musleabihf,
i486-linux-musl,
i686-linux-musl,
m68k-linux-musl,
microblaze-linux-musl,
microblazeel-linux-musl,
mips-linux-musl,
mips-linux-muslsf,
mips-linux-musln32sf,
mips64-linux-musl,
mips64-linux-musln32,
mips64-linux-musln32sf,
mips64el-linux-musl,
mips64el-linux-musln32,
mips64el-linux-musln32sf,
mipsel-linux-musl,
mipsel-linux-musln32,
mipsel-linux-musln32sf,
mipsel-linux-muslsf,
or1k-linux-musl,
powerpc-linux-musl,
powerpc-linux-muslsf,
powerpc64-linux-musl,
powerpc64le-linux-musl,
powerpcle-linux-musl,
powerpcle-linux-muslsf,
riscv32-linux-musl,
riscv64-linux-musl,
s390x-linux-musl,
sh2-linux-musl,
sh2-linux-muslfdpic,
sh2eb-linux-musl,
sh2eb-linux-muslfdpic,
sh4-linux-musl,
sh4eb-linux-musl,
x86_64-linux-musl,
x86_64-linux-muslx32,
]
name: ${{ matrix.arch_type }}-${{ matrix.os }}
steps:
# 检出builder
- name: Checkout
uses: actions/checkout@v3
# 下载artifact
- name: Download artifact - musl-cross-make-master
uses: actions/download-artifact@v3
id: download
with:
name: musl-cross-make
path: artifacts
# 解压 文件夹改名
- name: Unpack musl-cross-make
run: |
tar -xf artifacts/musl-cross-make.tar.gz
mv musl-cross-make-musl.cc-old musl-cross-make
# 复制config.mak
- name: Copy config.mak to build directory
run: cp config.mak musl-cross-make/config.mak
# 编译 & install
- name: make & install ${{ matrix.arch_type }} toolchain
run: |
cd musl-cross-make
make -j$(nproc) install TARGET=${{ matrix.arch_type }} OUTPUT=/opt/${{ matrix.arch_type }}
# 复制execinfo.h
- name: Copy updated config.mak to build directory
run: cp execinfo.h /opt/${{ matrix.arch_type }}/${{ matrix.arch_type }}/include/execinfo.h
# 7z压缩
- name: archive ${{ matrix.arch_type }} toolchain
run: 7z a ${{ matrix.arch_type }}.7z /opt/${{ matrix.arch_type }}/
# 上传artifact
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch_type }}
path: ${{ matrix.arch_type }}.7z
# 获取所有的git log和tag
- name: Unshallow
run: git fetch --prune --unshallow
# 获取git log 从 previousTag 到 lastTag
- name: Get git log
id: git-log
run: |
previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
lastTag=$(git describe --abbrev=0 --tags)
echo "previousTag:$previousTag ~ lastTag:$lastTag"
log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S')
echo "$log"
echo "log_state="$log"" >> $GITHUB_ENV
# 创建Changelog文件 triggered by git tag push
- name: set release info dynamically from config.mak
run: |
printf "%s\n" "$(sed -rn "/GCC_VER = (.*)/,/MPFR_VER = (.*)/p" config.mak)" > release.md
echo -e '${{ env.log_state }}' >> release.md
# 创建release 上传release
# https://github.com/marketplace/actions/create-release
- name: Create release and upload-archive
uses: ncipollo/release-action@v1
with:
prerelease: false
name: musl toolchains ${{ github.ref }}
bodyFile: release.md
artifacts: ${{ matrix.arch_type }}.7z
allowUpdates: true
artifactContentType: application/x-7z-compressed
token: ${{ secrets.GITHUB_TOKEN }}