diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e4841c..1939336 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,7 @@ jobs: outputs: version: ${{ steps.check.outputs.version }} is_release: ${{ steps.check.outputs.is_release }} + has_token: ${{ steps.check.outputs.has_token }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -65,12 +66,19 @@ jobs: echo "â„šī¸ Version normalized to: $version" fi + has_token="false" + if [ -n "${{ secrets.CARGO_REGISTRY_TOKEN }}" ]; then + has_token="true" + fi + echo "version=$version" >> $GITHUB_OUTPUT echo "is_release=$is_release" >> $GITHUB_OUTPUT + echo "has_token=$has_token" >> $GITHUB_OUTPUT echo "📊 Build Summary:" echo " - Version: $version" echo " - Is release: $is_release" + echo " - Publish crate: $has_token" build: name: Build (${{ matrix.os_name }}-${{ matrix.arch }}) @@ -83,7 +91,7 @@ jobs: matrix: include: # Linux - - os: ubuntu-latest + - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu os_name: linux arch: amd64 @@ -96,6 +104,20 @@ jobs: artifact_name: rc cross: true + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + os_name: linux + arch: amd64-musl + artifact_name: rc + cross: false + + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + os_name: linux + arch: arm64-musl + artifact_name: rc + cross: true + # macOS (both targets built on ARM64 runner with cross-compilation) - os: macos-latest target: x86_64-apple-darwin @@ -130,6 +152,13 @@ jobs: with: key: ${{ matrix.target }} + - name: Add Rust target + run: rustup target add ${{ matrix.target }} + + - name: Install musl-tools + if: contains(matrix.target, 'musl') + run: sudo apt-get update && sudo apt-get install -y musl-tools + # Install cross for cross-compilation - name: Install cross if: matrix.cross @@ -407,7 +436,7 @@ jobs: ```bash brew tap rustfs/homebrew-tap - + brew install rustfs/tap/rc ``` @@ -424,7 +453,7 @@ jobs: name: Publish to crates.io needs: [ build-check, build ] runs-on: ubuntu-latest - if: needs.build-check.outputs.is_release == 'true' + if: needs.build-check.outputs.is_release == 'true' && needs.build-check.outputs.has_token == 'true' steps: - name: Checkout repository uses: actions/checkout@v4