update/modularize output (#178) #1
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| - os: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - os: macos-15-intel | |
| target: x86_64-apple-darwin | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl toolchain (linux-musl) | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools | |
| - name: Build | |
| run: cargo build --release --locked --target ${{ matrix.target }} | |
| - name: Package | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| TARGET="${{ matrix.target }}" | |
| BIN="xfetch" | |
| [ "$RUNNER_OS" = "Windows" ] && BIN="xfetch.exe" | |
| mkdir -p stage | |
| cp "target/${TARGET}/release/${BIN}" "stage/${BIN}" | |
| cp LICENSE README.md stage/ | |
| if [ "$RUNNER_OS" = "Windows" ]; then | |
| tar -a -c -f "xfetch-${VERSION}-${TARGET}.zip" -C stage . | |
| else | |
| tar -czf "xfetch-${VERSION}-${TARGET}.tar.gz" -C stage . | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: xfetch-* | |
| if-no-files-found: error | |
| checksums: | |
| name: Generate SHA256SUMS | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: assets | |
| pattern: '*' | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd assets | |
| sha256sum * > SHA256SUMS | |
| cat SHA256SUMS | |
| - name: Upload checksums | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: checksums | |
| path: assets/SHA256SUMS | |
| release: | |
| name: Publish release | |
| needs: checksums | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: release-assets | |
| pattern: '*' | |
| merge-multiple: true | |
| - name: Publish GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| fail_on_unmatched_files: true | |
| files: release-assets/* |