# Build self-contained binaries for portable Linux RIDs when a version tag is pushed, # then create/update the release and attach the zips as release assets. # linux-x64 and linux-arm64 are built inside a container (Debian-based SDK image) so # the resulting binaries work across glibc-based distros (Ubuntu, Debian, etc.). # Run: push a tag (e.g. v1.0.0); the workflow builds that commit and uploads assets. name: Release on: push: tags: - 'v*' jobs: build: strategy: fail-fast: false matrix: rid: - linux-x64 - linux-arm64 - linux-musl-x64 - linux-musl-arm64 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Publish for ${{ matrix.rid }} (glibc in Docker) if: matrix.rid == 'linux-x64' || matrix.rid == 'linux-arm64' run: | docker run --rm \ -v "${{ github.workspace }}:/src" -w /src \ mcr.microsoft.com/dotnet/sdk:10.0 \ ./scripts/publish-self-contained.sh ${{ matrix.rid }} ${{ github.ref_name }} - name: Setup .NET if: matrix.rid == 'linux-musl-x64' || matrix.rid == 'linux-musl-arm64' uses: actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' - name: Publish for ${{ matrix.rid }} (musl on host) if: matrix.rid == 'linux-musl-x64' || matrix.rid == 'linux-musl-arm64' run: ./scripts/publish-self-contained.sh ${{ matrix.rid }} ${{ github.ref_name }} - name: Zip publish output run: | PUBLISH_DIR="src/DnsmasqWebUI/bin/Release/net10.0/${{ matrix.rid }}/publish" (cd "$PUBLISH_DIR" && zip -r "../../../../../../../dnsmasq-webui-${{ matrix.rid }}.zip" .) - name: Upload artifact uses: actions/upload-artifact@v4 with: name: dnsmasq-webui-${{ matrix.rid }} path: dnsmasq-webui-${{ matrix.rid }}.zip release: needs: build runs-on: ubuntu-latest permissions: contents: write steps: - name: Download all build artifacts uses: actions/download-artifact@v4 - name: Collect zips into workspace root run: | for dir in dnsmasq-webui-*/; do [ -d "$dir" ] && cp "$dir"/*.zip . 2>/dev/null || true done - name: Create release and upload assets uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.ref_name }} name: Release ${{ github.ref_name }} files: dnsmasq-webui-*.zip generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}