Try to build for all linux #9
This file contains hidden or 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
| name: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| - name: Install Cross Compilation Targets | |
| run: | | |
| rustup target add x86_64-unknown-linux-gnu | |
| rustup target add aarch64-unknown-linux-gnu | |
| rustup target add x86_64-apple-darwin | |
| rustup target add aarch64-apple-darwin | |
| rustup target add x86_64-pc-windows-gnu | |
| rustup target add aarch64-pc-windows-msvc | |
| cargo install cross | |
| - name: Build Binaries | |
| run: | | |
| version="${{ github.event.inputs.version }}" | |
| [ -z "$version" ] && version="latest" | |
| mkdir -p bin | |
| architectures=("x86_64") | |
| for arch in "${architectures[@]}"; do | |
| cross build --debug --target x86_64-unknown-linux-musl | |
| mv target/x86_64-unknown-linux-gnu/debug/journalview bin/journalview-$version-linux-$arch | |
| done | |
| echo "ARTIFACT_NAME=journalview-$(date +'%d.%m.%Y')" >> $GITHUB_ENV | |
| - name: Upload Binaries | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: bin/ |