feat: expose app config and render fields via the installations API (… #3263
Workflow file for this run
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 and test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| paths-ignore: | |
| - '**.md' | |
| - '.gitignore' | |
| - 'docker*.yaml' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint & Quality Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebp-dev | |
| - name: Setup Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Lint Go | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| - name: Setup Python for djLint | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.x' | |
| - name: Lint Templates | |
| run: | | |
| pip install djlint==1.40.8 | |
| djlint web/templates --profile=golang --check | |
| - name: Lint Dockerfile | |
| uses: hadolint/hadolint-action@v3.3.0 | |
| with: | |
| dockerfile: Dockerfile | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| goos: linux | |
| goarch: amd64 | |
| artifact_name: tronbyt-server-linux-amd64 | |
| - os: ubuntu-24.04-arm | |
| goos: linux | |
| goarch: arm64 | |
| artifact_name: tronbyt-server-linux-arm64 | |
| - os: macos-26 | |
| goos: darwin | |
| goarch: arm64 | |
| artifact_name: tronbyt-server-darwin-arm64 | |
| - os: windows-2025 | |
| goos: windows | |
| goarch: amd64 | |
| artifact_name: tronbyt-server-windows-amd64.exe | |
| steps: | |
| - uses: actions/checkout@v7 | |
| # Windows specific setup | |
| # Install GCC and Libwebp | |
| - name: Setup MSYS2 | |
| id: msys2 | |
| if: matrix.goos == 'windows' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| path-type: inherit | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-libwebp | |
| mingw-w64-x86_64-pkgconf | |
| - name: Set CGO Flags (windows) | |
| if: matrix.goos == 'windows' | |
| run: | | |
| # Retrieve the install location from the previous step | |
| MSYS_ROOT="${{ steps.msys2.outputs.msys2-location }}" | |
| echo "Using MSYS2 at: $MSYS_ROOT" | |
| # Convert backslashes to forward slashes for GCC compatibility | |
| MSYS_ROOT=$(echo "$MSYS_ROOT" | sed 's/\\/\//g') | |
| # Write to GITHUB_ENV so following steps (like 'go build') can see them | |
| echo "CGO_CFLAGS=-I${MSYS_ROOT}/mingw64/include" >> "$GITHUB_ENV" | |
| echo "CGO_LDFLAGS=-L${MSYS_ROOT}/mingw64/lib" >> "$GITHUB_ENV" | |
| # Optional: Add the mingw64 bin folder to PATH so dlls are found during tests | |
| echo "${MSYS_ROOT}/mingw64/bin" >> "$GITHUB_PATH" | |
| # Linux/Mac specific setup | |
| - name: Install system dependencies | |
| if: matrix.goos != 'windows' | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update | |
| sudo apt-get install -y libwebp-dev | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| brew install webp | |
| fi | |
| - name: Setup Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Test | |
| env: | |
| CGO_ENABLED: 1 # CGO required for pixlet | |
| run: go test -v ./... | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: 1 | |
| run: | | |
| VERSION=${GITHUB_REF_NAME} | |
| COMMIT=${GITHUB_SHA} | |
| DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| # Base flags | |
| LDFLAGS="-w -s -X 'tronbyt-server/internal/version.Version=${VERSION}' -X 'tronbyt-server/internal/version.Commit=${COMMIT}' -X 'tronbyt-server/internal/version.BuildDate=${DATE}'" | |
| # Add static flags ONLY for Windows to avoid DLL dependency | |
| if [ "${{ matrix.goos }}" == "windows" ]; then | |
| LDFLAGS="${LDFLAGS} -extldflags '-static'" | |
| fi | |
| go build -v -ldflags "${LDFLAGS}" -tags gzip_fonts -o ${{ matrix.artifact_name }} ./cmd/server | |
| - name: Upload Release Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_name }} | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [lint, build-and-test] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Fetch All Release Artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| # Collect all artifacts and pass them to gh release create as positional arguments | |
| gh release create "$tag" \ | |
| --repo="${GITHUB_REPOSITORY}" \ | |
| --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ | |
| --generate-notes \ | |
| $(find dist -type f -print0 | xargs -0) |