Skip to content

perf: drop bigcache for FileByteCache/AnomalyFailureStore and lower caps #19

perf: drop bigcache for FileByteCache/AnomalyFailureStore and lower caps

perf: drop bigcache for FileByteCache/AnomalyFailureStore and lower caps #19

Workflow file for this run

name: Build RenoP
on:
push:
workflow_dispatch:
permissions:
contents: write
jobs:
metadata:
name: Read commit build metadata
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.metadata.outputs.skip }}
release: ${{ steps.metadata.outputs.release }}
version: ${{ steps.metadata.outputs.version }}
development: ${{ steps.metadata.outputs.development }}
tag: ${{ steps.metadata.outputs.tag }}
commit: ${{ steps.metadata.outputs.commit }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Inspect commit message
id: metadata
shell: pwsh
run: |
$message = (git log -1 --format=%s).Trim()
$commit = (git rev-parse HEAD).Trim()
$skip = $message.StartsWith('[skip ci]', [StringComparison]::OrdinalIgnoreCase) -or
$message.StartsWith('[ci skip]', [StringComparison]::OrdinalIgnoreCase) -or
$message.StartsWith('[web]', [StringComparison]::OrdinalIgnoreCase)
$release = $false
$version = ''
if (-not $skip -and $message.StartsWith('[release]', [StringComparison]::OrdinalIgnoreCase)) {
$version = $message.Substring('[release]'.Length).Trim()
if ([string]::IsNullOrWhiteSpace($version)) {
throw 'A [release] commit must include a version, for example: [release] v1.2.3'
}
$release = $true
} elseif (-not $skip) {
$version = (git rev-parse --short HEAD).Trim()
}
$development = if ($release) { 'false' } else { 'true' }
$tag = if ($release) { $version } else { '' }
"skip=$($skip.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
"release=$($release.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
"version=$version" >> $env:GITHUB_OUTPUT
"development=$development" >> $env:GITHUB_OUTPUT
"tag=$tag" >> $env:GITHUB_OUTPUT
"commit=$commit" >> $env:GITHUB_OUTPUT
Write-Host "Commit: $message"
Write-Host "Version: $version sha=$commit (development=$development, skip=$skip)"
build:
name: Build all platforms
needs: metadata
if: needs.metadata.outputs.skip != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install latest Go
uses: actions/setup-go@v7
with:
go-version: stable
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 11.7.0
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install protoc
uses: ./.github/actions/setup-protoc
with:
version: "35.1"
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- name: Build and package
shell: pwsh
env:
RENOP_VERSION: ${{ needs.metadata.outputs.version }}
RENOP_DEVELOPMENT: ${{ needs.metadata.outputs.development }}
run: pwsh -NoProfile -File ./build.ps1 -Version $env:RENOP_VERSION -Development $env:RENOP_DEVELOPMENT
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: dist-artifacts
path: dist/
publish:
name: Publish to official update host
needs: [metadata, build]
if: needs.metadata.outputs.skip != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
pattern: '*'
path: dist
merge-multiple: true
- name: Publish packages
shell: pwsh
env:
RENOP_PUBLISH_TOKEN: ${{ secrets.RENOP_PUBLISH_TOKEN }}
IS_RELEASE: ${{ needs.metadata.outputs.release }}
VERSION: ${{ needs.metadata.outputs.version }}
COMMIT: ${{ needs.metadata.outputs.commit }}
run: |
if ([string]::IsNullOrWhiteSpace($env:RENOP_PUBLISH_TOKEN)) {
throw 'Repository secret RENOP_PUBLISH_TOKEN is not set'
}
$channel = if ($env:IS_RELEASE -eq 'true') { 'stable' } else { 'nightly' }
pwsh -NoProfile -File ./.github/scripts/publish-update.ps1 `
-Channel $channel `
-DistDir ./dist `
-Version $env:VERSION `
-Commit $env:COMMIT
release:
name: Publish GitHub release notes
needs: [metadata, build, publish]
if: needs.metadata.outputs.release == 'true' && needs.metadata.outputs.skip != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Build changelog from commits
id: changelog
shell: pwsh
env:
COMMIT: ${{ needs.metadata.outputs.commit }}
run: |
$out = Join-Path $env:RUNNER_TEMP 'release-notes.md'
$footer = 'Downloads: https://mvnc.pkg.one/update/renop/stable'
pwsh -NoProfile -File ./.github/scripts/generate-changelog.ps1 `
-Commit $env:COMMIT `
-OutFile $out `
-Footer $footer
"path=$out" >> $env:GITHUB_OUTPUT
Write-Host "----- release notes -----"
Get-Content -LiteralPath $out -Raw
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.metadata.outputs.tag }}
target_commitish: ${{ needs.metadata.outputs.commit }}
generate_release_notes: false
body_path: ${{ steps.changelog.outputs.path }}