name: build on: push: branches: [master] tags: ['v*'] pull_request: workflow_dispatch: jobs: build: strategy: fail-fast: false matrix: include: - os: ubuntu-latest rid: linux-x64 - os: windows-latest rid: win-x64 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 - uses: actions/setup-dotnet@v5 with: dotnet-version: 8.0.x - run: dotnet publish -c Release -r ${{ matrix.rid }} --self-contained -o publish - name: Package tarball if: runner.os == 'Linux' run: tar -czf SLAM-Cross-${{ matrix.rid }}.tar.gz -C publish . - name: Build AppImage if: runner.os == 'Linux' run: sh packaging/build-appimage.sh - name: Build deb and rpm if: runner.os == 'Linux' run: | v=0.0.0 case "$GITHUB_REF" in refs/tags/v*) v=${GITHUB_REF_NAME#v} ;; esac curl -sfL https://github.com/goreleaser/nfpm/releases/download/v2.47.0/nfpm_2.47.0_Linux_x86_64.tar.gz | tar xz nfpm VERSION=$v ./nfpm package -f packaging/nfpm.yaml -p deb VERSION=$v ./nfpm package -f packaging/nfpm.yaml -p rpm - name: Package zip if: runner.os == 'Windows' run: Compress-Archive -Path publish/* -DestinationPath SLAM-Cross-${{ matrix.rid }}.zip - uses: actions/upload-artifact@v7 with: name: SLAM-Cross-${{ matrix.rid }} path: | SLAM-Cross-*.tar.gz SLAM-Cross-*.zip SLAM-Cross-*.AppImage slam-cross*.deb slam-cross*.rpm release: if: startsWith(github.ref, 'refs/tags/v') needs: build runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@v8 with: merge-multiple: true - name: Create release env: GH_TOKEN: ${{ github.token }} run: > gh release create ${{ github.ref_name }} SLAM-Cross-linux-x64.tar.gz SLAM-Cross-win-x64.zip SLAM-Cross-x86_64.AppImage slam-cross*.deb slam-cross*.rpm --repo ${{ github.repository }} --title ${{ github.ref_name }} --generate-notes