Prebuild Steam Scrolls #319
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: Prebuild Steam Scrolls | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| targets: | |
| description: "one scroll, comma-separated scrolls, or all-steam" | |
| required: false | |
| default: "all-steam" | |
| schedule: | |
| - cron: "0 3 * * *" | |
| jobs: | |
| resolve-targets: | |
| runs-on: [self-hosted, nauen] | |
| outputs: | |
| targets: ${{ steps.targets.outputs.targets }} | |
| env: | |
| SELECTED_TARGETS: ${{ github.event_name == 'workflow_dispatch' && inputs.targets || 'all-steam' }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ">=1.22.3" | |
| - name: Resolve prebuild targets | |
| id: targets | |
| run: | | |
| set -euo pipefail | |
| targets="$(go run ./scripts/prebuild --targets "${SELECTED_TARGETS}" --list-targets)" | |
| echo "targets=${targets}" >> "$GITHUB_OUTPUT" | |
| echo "Resolved targets: ${targets}" | |
| build-steam: | |
| needs: resolve-targets | |
| runs-on: [self-hosted, nauen] | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 1 | |
| matrix: | |
| target: ${{ fromJson(needs.resolve-targets.outputs.targets) }} | |
| env: | |
| DRUID_CLI_VERSION: v0.1.257 | |
| DRUID_RUNTIME_IMAGE: artifacts.druid.gg/druid-team/druid:v0.1.257 | |
| DRUID_STEAM_RUNTIME_IMAGE: artifacts.druid.gg/druid-team/druid:v0.1.257-steamcmd | |
| PREBUILD_DOCKER_PLATFORM: linux/amd64 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ">=1.22.3" | |
| - name: Build scroll tree | |
| run: make build-tree | |
| - name: Get druid binary | |
| uses: robinraju/release-downloader@v1.7 | |
| with: | |
| repository: "highcard-dev/druid-cli" | |
| tag: ${{ env.DRUID_CLI_VERSION }} | |
| fileName: "druid" | |
| token: ${{ secrets.GO_REPO_TOKEN }} | |
| - name: Install druid | |
| run: | | |
| chmod +x druid | |
| mv druid /usr/local/bin/druid | |
| - name: Validate all scrolls | |
| run: ./scripts/validate_all_scrolls.sh | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: artifacts.druid.gg | |
| username: ${{ secrets.IMAGE_REGISTRY_USER }} | |
| password: ${{ secrets.IMAGE_REGISTRY_PASSWORD }} | |
| - name: Check disk before prebuild | |
| run: | | |
| set -euo pipefail | |
| df -h / "$GITHUB_WORKSPACE" /var/lib/docker 2>/dev/null || true | |
| docker system df || true | |
| - name: Prebuild and upload | |
| run: ./scripts/prebuild/prebuild.sh "${{ matrix.target }}" | |
| env: | |
| SCROLL_REGISTRY_HOST: ${{ secrets.SCROLL_REGISTRY_HOST }} | |
| SCROLL_REGISTRY_USER: ${{ secrets.SCROLL_REGISTRY_USER }} | |
| SCROLL_REGISTRY_PASSWORD: ${{ secrets.SCROLL_REGISTRY_PASSWORD }} | |
| - name: Check disk after prebuild | |
| if: always() | |
| run: | | |
| set -euo pipefail | |
| df -h / "$GITHUB_WORKSPACE" /var/lib/docker 2>/dev/null || true | |
| docker system df || true |