migrate config system to arc_swap #188
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 | |
| env: | |
| BIN_NAME: wings-rs | |
| PROJECT_NAME: wings-rs | |
| jobs: | |
| dist: | |
| name: Dist | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - x86_64-linux | |
| - aarch64-linux | |
| - riscv64-linux | |
| - ppc64le-linux | |
| include: | |
| - build: x86_64-linux | |
| os: ubuntu-24.04 | |
| target: x86_64-unknown-linux-musl | |
| - build: aarch64-linux | |
| os: ubuntu-24.04 | |
| target: aarch64-unknown-linux-musl | |
| - build: riscv64-linux | |
| os: ubuntu-24.04 | |
| target: riscv64gc-unknown-linux-gnu | |
| - build: ppc64le-linux | |
| os: ubuntu-24.04 | |
| target: powerpc64le-unknown-linux-gnu | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - 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: Run cargo test | |
| run: cross test --release --target ${{ matrix.target }} | |
| - name: Build release binary | |
| run: | | |
| RUSTFLAGS="-C target-feature=+crt-static" \ | |
| cross build --release --target ${{ matrix.target }} | |
| - name: Prepare binary with platform name | |
| run: | | |
| mkdir -p dist | |
| cp "target/${{ matrix.target }}/release/$BIN_NAME" "dist/$BIN_NAME-${{ matrix.build }}" | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.PROJECT_NAME }}-${{ matrix.build }} | |
| path: dist/${{ env.BIN_NAME }}-${{ matrix.build }} | |
| create-multiarch-image: | |
| name: Create multi-arch Docker image | |
| needs: [dist] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare binaries | |
| run: | | |
| mkdir -p .docker/amd64 .docker/arm64 .docker/riscv64 .docker/ppc64le .docker/s390x | |
| cp dist/${{ env.PROJECT_NAME }}-x86_64-linux/${{ env.BIN_NAME }}-x86_64-linux .docker/amd64/calagopus-wings | |
| cp dist/${{ env.PROJECT_NAME }}-aarch64-linux/${{ env.BIN_NAME }}-aarch64-linux .docker/arm64/calagopus-wings | |
| cp dist/${{ env.PROJECT_NAME }}-riscv64-linux/${{ env.BIN_NAME }}-riscv64-linux .docker/riscv64/calagopus-wings | |
| cp dist/${{ env.PROJECT_NAME }}-ppc64le-linux/${{ env.BIN_NAME }}-ppc64le-linux .docker/ppc64le/calagopus-wings | |
| chmod +x .docker/*/calagopus-wings | |
| - name: Extract version | |
| id: version | |
| run: echo "val=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT | |
| - name: Build & push multi-arch image (main) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le | |
| push: true | |
| tags: ghcr.io/${{ github.repository }}:nightly | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |