release: bump version to 0.1.2 #7
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: write | |
| env: | |
| BINARY_NAME: qd2 | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.asset_suffix }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-24.04 | |
| target: x86_64-unknown-linux-gnu | |
| asset_suffix: linux-x86_64 | |
| - runner: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| asset_suffix: linux-arm64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Linux build dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-4-dev libpixman-1-dev libusb-1.0-0-dev pkg-config dpkg-dev desktop-file-utils meson ninja-build | |
| - name: Install usbredir for qemu-display | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git clone --branch usbredir-0.13.0 --depth 1 https://gitlab.freedesktop.org/spice/usbredir.git /tmp/usbredir | |
| meson setup /tmp/usbredir/build /tmp/usbredir --prefix=/usr/local | |
| meson compile -C /tmp/usbredir/build | |
| sudo meson install -C /tmp/usbredir/build | |
| sudo ldconfig | |
| multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" | |
| { | |
| echo "PKG_CONFIG_PATH=/usr/local/lib/${multiarch}/pkgconfig:/usr/local/lib/pkgconfig" | |
| echo "LD_LIBRARY_PATH=/usr/local/lib/${multiarch}:/usr/local/lib" | |
| } >> "$GITHUB_ENV" | |
| pkg-config --modversion libusbredirhost | |
| pkg-config --modversion libusbredirparser-0.5 | |
| - name: Validate desktop launcher | |
| if: runner.os == 'Linux' | |
| run: desktop-file-validate packaging/linux/qd2.desktop | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Cargo build outputs | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Install Linux packaging tools | |
| if: runner.os == 'Linux' | |
| run: cargo install --locked cargo-deb cargo-generate-rpm | |
| - name: Build release binary | |
| run: cargo build --release --locked --target ${{ matrix.target }} | |
| - name: Package release artifact | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| version="${GITHUB_REF_NAME}" | |
| package_dir="${BINARY_NAME}-${version}-${{ matrix.asset_suffix }}" | |
| mkdir -p "dist/${package_dir}" | |
| cp "target/${{ matrix.target }}/release/${BINARY_NAME}" "dist/${package_dir}/" | |
| cp README.md "dist/${package_dir}/" | |
| tar -C dist -czf "dist/${package_dir}.tar.gz" "${package_dir}" | |
| - name: Package Linux installers | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| version="${GITHUB_REF_NAME#v}" | |
| cargo deb --no-build --target "${{ matrix.target }}" --output "dist/${BINARY_NAME}_${version}_${{ matrix.asset_suffix }}.deb" | |
| cargo generate-rpm --target "${{ matrix.target }}" -o "dist/${BINARY_NAME}-${version}-${{ matrix.asset_suffix }}.rpm" | |
| - name: Upload packaged artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: release-${{ matrix.target }} | |
| path: | | |
| dist/*.tar.gz | |
| dist/*.deb | |
| dist/*.rpm | |
| release: | |
| name: Publish release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Download packaged artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: release-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| find dist -maxdepth 1 -type f ! -name 'SHA256SUMS.txt' -print0 \ | |
| | sort -z \ | |
| | xargs -0 sha256sum > dist/SHA256SUMS.txt | |
| - name: Create GitHub release shell | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if ! gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| --verify-tag \ | |
| --title "${GITHUB_REF_NAME}" \ | |
| --notes "" | |
| fi | |
| - name: Generate changelog with changelogithub | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx changelogithub | |
| - name: Upload release assets | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release upload "${GITHUB_REF_NAME}" dist/* --clobber |