|
| 1 | +name: Release Intiface Engine |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'intiface-engine-v*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Build ${{ matrix.platform }} ${{ matrix.arch }} |
| 11 | + runs-on: ${{ matrix.runner }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - runner: ubuntu-latest |
| 17 | + platform: linux |
| 18 | + arch: x64 |
| 19 | + exe: intiface-engine |
| 20 | + zip: intiface-engine-linux-x64-Release.zip |
| 21 | + |
| 22 | + - runner: ubuntu-24.04-arm |
| 23 | + platform: linux |
| 24 | + arch: arm64 |
| 25 | + exe: intiface-engine |
| 26 | + zip: intiface-engine-linux-arm64-Release.zip |
| 27 | + |
| 28 | + - runner: windows-latest |
| 29 | + platform: win |
| 30 | + arch: x64 |
| 31 | + exe: intiface-engine.exe |
| 32 | + zip: intiface-engine-win-x64-Release.zip |
| 33 | + |
| 34 | + - runner: macos-latest |
| 35 | + platform: macos |
| 36 | + arch: arm64 |
| 37 | + exe: intiface-engine |
| 38 | + zip: intiface-engine-macos-arm64-Release.zip |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Install system dependencies |
| 44 | + if: matrix.platform == 'linux' |
| 45 | + run: | |
| 46 | + sudo apt-get -y update |
| 47 | + sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev |
| 48 | +
|
| 49 | + - name: Install Rust toolchain |
| 50 | + uses: dtolnay/rust-toolchain@nightly |
| 51 | + |
| 52 | + - name: Cache Rust artifacts |
| 53 | + uses: Swatinem/rust-cache@v2 |
| 54 | + with: |
| 55 | + key: ${{ matrix.platform }}-${{ matrix.arch }} |
| 56 | + |
| 57 | + - name: Build release binary |
| 58 | + run: cargo build --release -p intiface-engine |
| 59 | + |
| 60 | + - name: Prepare artifact |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + mkdir -p staging |
| 64 | + cp target/release/${{ matrix.exe }} staging/ |
| 65 | + cp crates/intiface_engine/README.md staging/ |
| 66 | + cp crates/intiface_engine/CHANGELOG.md staging/ |
| 67 | +
|
| 68 | + - name: Upload artifact |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: ${{ matrix.zip }} |
| 72 | + path: staging/ |
| 73 | + |
| 74 | + release: |
| 75 | + name: Create GitHub Release |
| 76 | + needs: build |
| 77 | + runs-on: ubuntu-latest |
| 78 | + permissions: |
| 79 | + contents: write |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + |
| 83 | + - name: Download all artifacts |
| 84 | + uses: actions/download-artifact@v4 |
| 85 | + with: |
| 86 | + path: artifacts/ |
| 87 | + |
| 88 | + - name: Zip release packages |
| 89 | + run: | |
| 90 | + cd artifacts |
| 91 | + for dir in */; do |
| 92 | + zip_name="${dir%/}" |
| 93 | + (cd "$dir" && zip -j "../${zip_name}" *) |
| 94 | + done |
| 95 | + ls -la *.zip |
| 96 | +
|
| 97 | + - name: Create GitHub Release |
| 98 | + uses: softprops/action-gh-release@v2 |
| 99 | + with: |
| 100 | + files: artifacts/*.zip |
| 101 | + generate_release_notes: true |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments