chore(deps-dev): bump typescript from 5.9.3 to 6.0.2 in /ui (#363) #292
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*.*.*" | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| docker: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| digest: linux-amd64 | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| digest: linux-arm64 | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| ghcr.io/ocap2/web | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| build-args: | | |
| build_version=${{ github.ref_name }} | |
| build_commit=${{ github.sha }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.platform }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.platform }} | |
| outputs: type=image,name=ghcr.io/ocap2/web,push-by-digest=true,name-canonical=true,push=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p /tmp/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "/tmp/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: digests-${{ matrix.digest }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| docker-merge: | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: /tmp/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| ghcr.io/ocap2/web | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
| $(printf 'ghcr.io/ocap2/web@sha256:%s ' *) | |
| - name: Inspect image | |
| run: | | |
| docker buildx imagetools inspect ghcr.io/ocap2/web:${{ steps.meta.outputs.version }} | |
| docker-full: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| digest: linux-amd64 | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| digest: linux-arm64 | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| ghcr.io/ocap2/web | |
| tags: | | |
| type=ref,event=branch,suffix=-full | |
| type=semver,pattern={{version}},suffix=-full | |
| type=semver,pattern={{major}}.{{minor}},suffix=-full | |
| type=semver,pattern={{major}},suffix=-full | |
| type=sha,suffix=-full | |
| type=raw,value=full,enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| build-args: | | |
| build_version=${{ github.ref_name }} | |
| build_commit=${{ github.sha }} | |
| VARIANT=full | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=full-${{ matrix.platform }} | |
| cache-to: type=gha,mode=max,scope=full-${{ matrix.platform }} | |
| outputs: type=image,name=ghcr.io/ocap2/web,push-by-digest=true,name-canonical=true,push=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p /tmp/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "/tmp/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: full-digests-${{ matrix.digest }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| docker-full-merge: | |
| runs-on: ubuntu-latest | |
| needs: docker-full | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: /tmp/digests | |
| pattern: full-digests-* | |
| merge-multiple: true | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| ghcr.io/ocap2/web | |
| tags: | | |
| type=ref,event=branch,suffix=-full | |
| type=semver,pattern={{version}},suffix=-full | |
| type=semver,pattern={{major}}.{{minor}},suffix=-full | |
| type=semver,pattern={{major}},suffix=-full | |
| type=sha,suffix=-full | |
| type=raw,value=full,enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
| $(printf 'ghcr.io/ocap2/web@sha256:%s ' *) | |
| - name: Inspect image | |
| run: | | |
| docker buildx imagetools inspect ghcr.io/ocap2/web:${{ steps.meta.outputs.version }} | |
| release-binaries: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: windows | |
| goarch: amd64 | |
| cc: x86_64-w64-mingw32-gcc | |
| cxx: x86_64-w64-mingw32-g++ | |
| binary: ocap-webserver.exe | |
| archive: ocap-webserver-windows-amd64.zip | |
| archiver: zip -r | |
| - goos: linux | |
| goarch: amd64 | |
| cc: gcc | |
| cxx: g++ | |
| binary: ocap-webserver | |
| archive: ocap-webserver-linux-amd64.tar.gz | |
| archiver: tar -czvf | |
| - goos: linux | |
| goarch: arm64 | |
| cc: aarch64-linux-gnu-gcc | |
| cxx: aarch64-linux-gnu-g++ | |
| binary: ocap-webserver | |
| archive: ocap-webserver-linux-arm64.tar.gz | |
| archiver: tar -czvf | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install cross compile dependencies | |
| run: sudo apt-get update && sudo apt-get install -y gcc-mingw-w64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Build frontend | |
| working-directory: ui | |
| run: npm ci && npm run build | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Build binary | |
| env: | |
| CGO_ENABLED: 1 | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| run: | | |
| go build -ldflags "-X github.com/OCAP2/web/internal/server.BuildVersion=${{ github.ref_name }} -X github.com/OCAP2/web/internal/server.BuildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -X github.com/OCAP2/web/internal/server.BuildCommit=$GITHUB_SHA" -o ${{ matrix.binary }} ./cmd/ocap-webserver | |
| - name: Create release archive | |
| run: | | |
| mkdir -p release/assets | |
| cp ${{ matrix.binary }} release/ | |
| cp -r assets/markers release/assets/ | |
| cp -r assets/ammo release/assets/ | |
| cp -r assets/fonts release/assets/ | |
| cp setting.json.example release/ | |
| cd release && ${{ matrix.archiver }} ../${{ matrix.archive }} . | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ matrix.archive }} |