Skip to content

Use musl target for Linux #25

Use musl target for Linux

Use musl target for Linux #25

Workflow file for this run

name: CD
on:
push:
pull_request:
permissions:
contents: read
jobs:
artifact:
strategy:
fail-fast: false
matrix:
include:
- type: windows-x64
os: windows-latest
target: x86_64-pc-windows-msvc
- type: linux-x64
os: ubuntu-latest
target: x86_64-unknown-linux-musl
name: Upload Artifact (${{ matrix.type }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
shell: bash
run: |
cargo build --verbose --locked --release
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: dxm-${{ matrix.type }}
path: ./target/release/dxm${{ runner.os == 'Windows' && '.exe' || '' }}
release:
name: Draft Release
runs-on: ubuntu-latest
needs: artifact
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
permissions:
contents: write
steps:
- name: Download archives
uses: actions/download-artifact@v7
- name: Archive
shell: bash
run: |
version="${{ github.ref_name }}"
for file in *; do
pushd "$file"
if [[ "$file" == *"-windows-"* ]]; then
zip "../dxm-$version-${file:4}.zip" "dxm.exe"
else
tar -czvf "../dxm-$version-${file:4}.tar.gz" "dxm"
fi
popd
done
- name: Draft release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
files: |
./*.zip
./*.tar.gz
crates:
name: Publish Crates
runs-on: ubuntu-latest
needs: release
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish crates
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}