mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 16:28:15 +00:00
34dc49c2f5
Ensure the static directory is copied as a sibling to the rustfs binary in the artifact package, maintaining the proper directory structure for the application to locate its resources.
82 lines
2.7 KiB
YAML
82 lines
2.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 * * 0' # at midnight of each sunday
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-rustfs:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
variant:
|
|
- { profile: dev, target: x86_64-unknown-linux-gnu, glibc: "default" }
|
|
- { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" }
|
|
- { profile: release, target: x86_64-unknown-linux-gnu, glibc: "2.31" }
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/setup
|
|
with:
|
|
cache-shared-key: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }}
|
|
|
|
- name: Build
|
|
run: |
|
|
./scripts/build.py \
|
|
--profile ${{ matrix.variant.profile }} \
|
|
--target ${{ matrix.variant.target }} \
|
|
--glibc ${{ matrix.variant.glibc }}
|
|
|
|
- name: Download and Extract Static Assets
|
|
run: |
|
|
url="https://dl.rustfs.com/console/rustfs-console-latest.zip"
|
|
mkdir -p static
|
|
curl -L -o static_assets.zip "$url"
|
|
unzip -o static_assets.zip -d static
|
|
rm static_assets.zip
|
|
ls -la static
|
|
|
|
- name: Package Binary and Static Assets
|
|
id: package
|
|
run: |
|
|
# Create artifact filename
|
|
ARTIFACT_NAME="rustfs-${{ matrix.variant.profile }}-${{ matrix.variant.target }}"
|
|
if [ "${{ matrix.variant.glibc }}" != "default" ]; then
|
|
ARTIFACT_NAME="${ARTIFACT_NAME}-glibc${{ matrix.variant.glibc }}"
|
|
fi
|
|
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
|
|
|
# Determine binary path
|
|
bin_path="target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.bin"
|
|
if [ -f "target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin" ]; then
|
|
bin_path="target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin"
|
|
fi
|
|
|
|
# Create package
|
|
mkdir -p ${ARTIFACT_NAME}
|
|
cp "$bin_path" ${ARTIFACT_NAME}/rustfs
|
|
cp -r static ${ARTIFACT_NAME}/
|
|
zip -r ${ARTIFACT_NAME}.zip ${ARTIFACT_NAME}
|
|
ls -la
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ steps.package.outputs.artifact_name }}
|
|
path: ${{ steps.package.outputs.artifact_name }}.zip
|
|
retention-days: 7
|
|
|
|
merge:
|
|
runs-on: ubuntu-latest
|
|
needs: build-rustfs
|
|
steps:
|
|
- uses: actions/upload-artifact/merge@v4
|
|
with:
|
|
name: rustfs-packages
|
|
pattern: 'rustfs-*'
|
|
delete-merged: true
|