diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d21e1700..3dfa9cb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,23 +3,36 @@ name: Publish Artifacts on: push: tags: - - '[0-9]+\.[0-9]+\.[0-9]+' + - '[0-9]+\.[0-9]+\.0' jobs: build: - runs-on: ubuntu-latest + name: Build ${{ matrix.target }} + runs-on: ${{ matrix.os }} strategy: matrix: - target: - - x86_64-unknown-linux-gnu - - x86_64-pc-windows-gnu - - x86_64-unknown-freebsd - - i686-unknown-linux-gnu - - i686-pc-windows-gnu - - aarch64-unknown-linux-gnu + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + - os: ubuntu-latest + target: i686-unknown-linux-musl + + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + + - os: windows-latest + target: x86_64-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + - os: windows-latest + target: i686-pc-windows-msvc steps: - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Rust uses: actions-rs/toolchain@v1 @@ -55,52 +68,12 @@ jobs: name: binaries path: dist/* - build-macos: - runs-on: macos-latest - strategy: - matrix: - target: - - x86_64-apple-darwin - - aarch64-apple-darwin - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - - name: Install additional targets - run: rustup target add ${{ matrix.target }} - - - name: Build the binary on macOS - run: cargo build --release --target ${{ matrix.target }} - - - name: Copy macOS binaries - run: | - mkdir -p dist - ARCH=$(echo ${{ matrix.target }} | cut -d '-' -f 1) - if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then - cp target/${{ matrix.target }}/release/cord dist/${ARCH}-darwin-cord - elif [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then - cp target/${{ matrix.target }}/release/cord dist/${ARCH}-darwin-cord - fi - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: binaries - path: dist/* - upload-artifacts: - needs: [build, build-macos] + needs: [build] runs-on: ubuntu-latest steps: - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: binaries path: dist