Open URLs with anchors #1473
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 Nightly | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 1.1.x | |
| env: | |
| BIN_NAME: panel-rs | |
| AIO_BIN_NAME: panel-rs-aio | |
| PROJECT_NAME: panel-rs | |
| GHCR_IMAGE: ghcr.io/${{ github.repository }} | |
| DOCKERHUB_IMAGE: docker.io/${{ github.repository }} | |
| IMAGE_PREFIX: ${{ github.ref_name == 'main' && 'nightly' || 'next' }} | |
| jobs: | |
| build-frontend: | |
| name: Build Frontend | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 11 | |
| run_install: false | |
| - name: Install frontend dependencies | |
| run: | | |
| cd frontend | |
| pnpm install | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| pnpm build:ci | |
| - name: Upload frontend build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: frontend-build | |
| path: frontend/dist/ | |
| dist: | |
| name: Dist | |
| needs: [build-frontend] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - x86_64-linux | |
| - aarch64-linux | |
| - riscv64-linux | |
| - ppc64le-linux | |
| #- x86_64-windows | |
| include: | |
| - build: x86_64-linux | |
| os: ubuntu-24.04 | |
| target: x86_64-unknown-linux-musl | |
| binary_suffix: "" | |
| wings_platform: linux/amd64 | |
| - build: aarch64-linux | |
| os: ubuntu-24.04 | |
| target: aarch64-unknown-linux-musl | |
| binary_suffix: "" | |
| wings_platform: linux/arm64 | |
| - build: riscv64-linux | |
| os: ubuntu-24.04 | |
| target: riscv64gc-unknown-linux-gnu | |
| binary_suffix: "" | |
| wings_platform: linux/riscv64 | |
| - build: ppc64le-linux | |
| os: ubuntu-24.04 | |
| target: powerpc64le-unknown-linux-gnu | |
| binary_suffix: "" | |
| wings_platform: linux/ppc64le | |
| #- build: x86_64-windows | |
| # os: windows-latest | |
| # target: x86_64-pc-windows-msvc | |
| # binary_suffix: ".exe" | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Download frontend build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: frontend-build | |
| path: frontend/dist/ | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| cache-key: ${{ matrix.target }} | |
| - name: Install cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Extract nightly wings binary | |
| run: | | |
| mkdir -p bins/all-in-one/bins | |
| docker pull --platform ${{ matrix.wings_platform }} ghcr.io/calagopus/wings:nightly | |
| cid=$(docker create --platform ${{ matrix.wings_platform }} ghcr.io/calagopus/wings:nightly) | |
| docker cp "$cid:/usr/bin/calagopus-wings" bins/all-in-one/bins/wings-nightly-bin | |
| docker rm "$cid" | |
| chmod +x bins/all-in-one/bins/wings-nightly-bin | |
| - name: Build release binaries | |
| env: | |
| WINGS_RELEASE: nightly | |
| WINGS_BINARY_PATH: bins/wings-nightly-bin | |
| run: | | |
| RUSTFLAGS="-C target-feature=+crt-static" \ | |
| cross build --release --target ${{ matrix.target }} -p $BIN_NAME | |
| cross build --release --target ${{ matrix.target }} -p $AIO_BIN_NAME | |
| - name: Prepare binaries | |
| run: | | |
| mkdir -p dist | |
| cp "target/${{ matrix.target }}/release/$BIN_NAME" "dist/$BIN_NAME-${{ matrix.build }}" | |
| cp "target/${{ matrix.target }}/release/$AIO_BIN_NAME" "dist/$AIO_BIN_NAME-${{ matrix.build }}" | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.PROJECT_NAME }}-${{ matrix.build }} | |
| path: | | |
| dist/${{ env.BIN_NAME }}-${{ matrix.build }} | |
| dist/${{ env.AIO_BIN_NAME }}-${{ matrix.build }} | |
| generate-sbom: | |
| name: Generate SBOM | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Generate source SBOM | |
| uses: anchore/sbom-action@v0 | |
| with: | |
| path: . | |
| format: cyclonedx-json | |
| output-file: sbom-source.cyclonedx.json | |
| artifact-name: sbom-source.cyclonedx.json | |
| upload-artifact: true | |
| create-multiarch-images: | |
| name: Create multi-arch ${{ matrix.variant }} Docker image | |
| needs: [dist, generate-sbom] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - variant: main | |
| dockerfile: Dockerfile | |
| tag_suffix: "" | |
| - variant: aio | |
| dockerfile: Dockerfile.aio | |
| tag_suffix: -aio | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download source SBOM | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: sbom-source.cyclonedx.json | |
| path: sbom | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Prepare binaries | |
| run: | | |
| mkdir -p .docker/amd64 .docker/arm64 .docker/riscv64 .docker/ppc64le | |
| cp dist/${{ env.PROJECT_NAME }}-x86_64-linux/${{ env.BIN_NAME }}-x86_64-linux .docker/amd64/panel-rs | |
| cp dist/${{ env.PROJECT_NAME }}-aarch64-linux/${{ env.BIN_NAME }}-aarch64-linux .docker/arm64/panel-rs | |
| cp dist/${{ env.PROJECT_NAME }}-riscv64-linux/${{ env.BIN_NAME }}-riscv64-linux .docker/riscv64/panel-rs | |
| cp dist/${{ env.PROJECT_NAME }}-ppc64le-linux/${{ env.BIN_NAME }}-ppc64le-linux .docker/ppc64le/panel-rs | |
| cp dist/${{ env.PROJECT_NAME }}-x86_64-linux/${{ env.AIO_BIN_NAME }}-x86_64-linux .docker/amd64/panel-rs-aio | |
| cp dist/${{ env.PROJECT_NAME }}-aarch64-linux/${{ env.AIO_BIN_NAME }}-aarch64-linux .docker/arm64/panel-rs-aio | |
| cp dist/${{ env.PROJECT_NAME }}-riscv64-linux/${{ env.AIO_BIN_NAME }}-riscv64-linux .docker/riscv64/panel-rs-aio | |
| cp dist/${{ env.PROJECT_NAME }}-ppc64le-linux/${{ env.AIO_BIN_NAME }}-ppc64le-linux .docker/ppc64le/panel-rs-aio | |
| chmod +x .docker/*/panel-rs .docker/*/panel-rs-aio | |
| - name: Build & push multi-arch image | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./docker/${{ matrix.dockerfile }} | |
| platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le | |
| push: true | |
| tags: | | |
| ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}${{ matrix.tag_suffix }} | |
| ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}${{ matrix.tag_suffix }} | |
| sbom: true | |
| provenance: true | |
| cache-from: type=gha,scope=${{ matrix.variant }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.variant }} | |
| - name: Attach source SBOM attestation to image (GHCR) | |
| uses: actions/attest-sbom@v4 | |
| with: | |
| subject-name: ${{ env.GHCR_IMAGE }} | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| sbom-path: sbom/sbom-source.cyclonedx.json | |
| push-to-registry: true | |
| - name: Attach source SBOM attestation to image (Docker Hub) | |
| uses: actions/attest-sbom@v4 | |
| with: | |
| subject-name: ${{ env.DOCKERHUB_IMAGE }} | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| sbom-path: sbom/sbom-source.cyclonedx.json | |
| push-to-registry: true | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v4.1.2 | |
| - name: Sign image with cosign | |
| run: | | |
| cosign sign --yes ${{ env.GHCR_IMAGE }}@${{ steps.build.outputs.digest }} | |
| cosign sign --yes ${{ env.DOCKERHUB_IMAGE }}@${{ steps.build.outputs.digest }} | |
| build-heavy-images: | |
| name: Build ${{ matrix.variant }} Docker image (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - variant: heavy | |
| dockerfile: Dockerfile.heavy | |
| platform: linux/amd64 | |
| runner: ubuntu-24.04 | |
| tag_suffix: amd64 | |
| build_args: "" | |
| - variant: heavy | |
| dockerfile: Dockerfile.heavy | |
| platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| tag_suffix: arm64 | |
| build_args: "" | |
| - variant: heavy-aio | |
| dockerfile: Dockerfile.heavy.aio | |
| platform: linux/amd64 | |
| runner: ubuntu-24.04 | |
| tag_suffix: amd64 | |
| build_args: WINGS_SOURCE=nightly | |
| - variant: heavy-aio | |
| dockerfile: Dockerfile.heavy.aio | |
| platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| tag_suffix: arm64 | |
| build_args: WINGS_SOURCE=nightly | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build & push platform image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./docker/${{ matrix.dockerfile }} | |
| platforms: ${{ matrix.platform }} | |
| build-args: ${{ matrix.build_args }} | |
| push: true | |
| tags: | | |
| ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-${{ matrix.tag_suffix }} | |
| ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-${{ matrix.tag_suffix }} | |
| sbom: scan-stages=true | |
| provenance: true | |
| cache-from: type=gha,scope=${{ matrix.variant }}-${{ matrix.tag_suffix }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.variant }}-${{ matrix.tag_suffix }} | |
| merge-heavy-images: | |
| name: Merge Heavy ${{ matrix.variant }} Docker manifest | |
| needs: [build-heavy-images] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| variant: [heavy, heavy-aio] | |
| steps: | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest (GHCR) | |
| run: | | |
| docker buildx imagetools create -t ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }} \ | |
| ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-amd64 \ | |
| ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-arm64 | |
| - name: Create and push multi-arch manifest (Docker Hub) | |
| run: | | |
| docker buildx imagetools create -t ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }} \ | |
| ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-amd64 \ | |
| ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }}-arm64 | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v4.1.2 | |
| - name: Sign image with cosign | |
| run: | | |
| cosign sign --yes ${{ env.GHCR_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }} | |
| cosign sign --yes ${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_PREFIX }}-${{ matrix.variant }} |