-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Musl build for Alpine Linux (#1770)
* musl build for Alpine Linux Signed-off-by: utnim2 <[email protected]> * fixed the path name Signed-off-by: utnim2 <[email protected]> --------- Signed-off-by: utnim2 <[email protected]>
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,58 @@ | ||
name: Build and Test Musl | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-test-musl: | ||
name: Build and Test on Alpine Linux (musl) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "true" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Pull Alpine Linux Docker image | ||
run: | | ||
docker pull alpine:latest | ||
- name: Build in Docker | ||
run: | | ||
docker run --rm \ | ||
-v ${{ github.workspace }}:/workspace -w /workspace \ | ||
alpine:latest \ | ||
/bin/sh -c " | ||
apk add --no-cache \ | ||
bash \ | ||
git \ | ||
make \ | ||
gcc \ | ||
musl-dev \ | ||
python3 \ | ||
python3-dev \ | ||
py3-pip \ | ||
rust \ | ||
cargo \ | ||
&& \ | ||
export KCL_BUILD_GIT_SHA=$(git rev-parse HEAD) && \ | ||
git config --global --add safe.directory /workspace && \ | ||
git config --global user.name 'GitHub Action' && \ | ||
git config --global user.email '[email protected]' && \ | ||
make && \ | ||
make release && \ | ||
_build/dist/linux/kclvm/bin/kclvm_cli version" | ||
- name: Read VERSION file | ||
id: read_version | ||
run: | | ||
VERSION=$(cat VERSION) | ||
echo "VERSION=v${VERSION}" >> $GITHUB_ENV | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kcl-${{ env.VERSION }}-linux-musl | ||
if-no-files-found: error | ||
path: _build/kclvm-${{ env.VERSION }}-linux-amd64.tar.gz |