fix(systemd): handle missing user dbus session on --install #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 | |
| jobs: | |
| build-linux: | |
| name: Build Linux (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - x86_64-unknown-linux-gnu | |
| - x86_64-unknown-linux-musl | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install musl tools | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release --locked --target ${{ matrix.target }} | |
| - name: Package | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| BIN_NAME="livesync-agent" | |
| VERSION="${GITHUB_REF_NAME}" | |
| TARGET="${{ matrix.target }}" | |
| ASSET_BASE="${BIN_NAME}-${VERSION}-${TARGET}" | |
| mkdir -p dist | |
| cp "target/${TARGET}/release/${BIN_NAME}" "dist/${BIN_NAME}" | |
| tar -C dist -czf "dist/${ASSET_BASE}.tar.gz" "${BIN_NAME}" | |
| rm -f "dist/${BIN_NAME}" | |
| (cd dist && sha256sum "${ASSET_BASE}.tar.gz" > "${ASSET_BASE}.sha256") | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-linux-${{ matrix.target }} | |
| path: dist/* | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: build-linux | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: release-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Build checksums file | |
| run: | | |
| set -euo pipefail | |
| cd dist | |
| cat *.sha256 > SHA256SUMS | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| dist/*.tar.gz | |
| dist/SHA256SUMS |