feat: liveness probes, recovery strategies, and skip_if rename #246
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: {} | |
| jobs: | |
| # ── Plan: semantic-release dry run to show next version ────────────── | |
| # Runs on both push and PR. On PR, checks out the merge ref and | |
| # pretends it's main so semantic-release computes the real version. | |
| plan: | |
| name: Plan Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| outputs: | |
| new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
| new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # On PR, the checkout is a detached merge ref — semantic-release | |
| # needs to see branch "main" to match .releaserc.json config. | |
| - name: Point local main at merge commit | |
| if: github.event_name == 'pull_request' | |
| run: git checkout -B main | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - uses: cycjimmy/semantic-release-action@v4 | |
| id: semantic | |
| with: | |
| dry_run: true | |
| extra_plugins: | | |
| @semantic-release/exec | |
| @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ── Build ALL artifacts BEFORE tagging ───────────────────────────── | |
| build: | |
| name: Build (${{ matrix.suffix }}) | |
| permissions: | |
| contents: read | |
| needs: plan | |
| if: >- | |
| github.event_name == 'push' | |
| && needs.plan.outputs.new_release_published == 'true' | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| suffix: macos-arm64 | |
| goos: darwin | |
| goarch: arm64 | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| suffix: macos-amd64 | |
| goos: darwin | |
| goarch: amd64 | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| suffix: linux-amd64 | |
| goos: linux | |
| goarch: amd64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| suffix: linux-arm64 | |
| cross: true | |
| goos: linux | |
| goarch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: crates/veld-daemon/frontend/package-lock.json | |
| - name: Install frontend dependencies | |
| run: cd crates/veld-daemon/frontend && npm ci | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Install cross-compilation tools | |
| if: matrix.cross | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config.toml | |
| echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml | |
| - name: Set release version in Cargo.toml | |
| run: | | |
| VERSION="${{ needs.plan.outputs.new_release_version }}" | |
| sed -i'' -e "s/^version = \"[^\"]*\"/version = \"${VERSION}\"/" Cargo.toml | |
| - name: Build release binaries | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build Caddy with veld_inject | |
| run: | | |
| export PATH="$(go env GOPATH)/bin:$PATH" | |
| XCADDY_VERSION=$(cat .xcaddy-version) | |
| go install "github.com/caddyserver/xcaddy/cmd/xcaddy@v${XCADDY_VERSION}" | |
| GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} xcaddy build \ | |
| --with github.com/prosperity-solutions/veld/caddy/inject=./caddy/inject \ | |
| --output dist/caddy | |
| chmod +x dist/caddy | |
| - name: Package binaries | |
| run: | | |
| mkdir -p dist | |
| for bin in veld veld-helper veld-daemon; do | |
| cp target/${{ matrix.target }}/release/$bin dist/ | |
| done | |
| tar -czf veld-${{ needs.plan.outputs.new_release_version }}-${{ matrix.suffix }}.tar.gz -C dist . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: veld-${{ matrix.suffix }} | |
| path: veld-*.tar.gz | |
| # ── All builds passed → create the tag ───────────────────────────── | |
| release: | |
| name: Tag & Release | |
| needs: [plan, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| outputs: | |
| new_release_git_tag: ${{ steps.semantic.outputs.new_release_git_tag }} | |
| new_release_notes: ${{ steps.semantic.outputs.new_release_notes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - uses: cycjimmy/semantic-release-action@v4 | |
| id: semantic | |
| with: | |
| extra_plugins: | | |
| @semantic-release/exec | |
| @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ── Attach pre-built artifacts to the release ────────────────────── | |
| publish: | |
| name: Publish Artifacts | |
| permissions: | |
| contents: write | |
| needs: [plan, release] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| sha256sum *.tar.gz > checksums.txt | |
| - name: Write release notes | |
| run: echo "$RELEASE_NOTES" > release-notes.md | |
| env: | |
| RELEASE_NOTES: ${{ needs.release.outputs.new_release_notes }} | |
| - name: Upload assets to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.release.outputs.new_release_git_tag }} | |
| name: ${{ needs.release.outputs.new_release_git_tag }} | |
| body_path: release-notes.md | |
| files: artifacts/* |