mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
checkout v4->v7, setup-go v5->v7, setup-node v4->v7, setup-java v4->v5, upload-artifact v4->v7, cache v4->v6, upload-pages-artifact v3->v5, deploy-pages v4->v5, setup-chrome v1->v2, setup-android v3->v4, goreleaser-action v6->v7. setup-bun and android-emulator-runner are already node24; buf-setup-action stays on its deliberate SHA pin. setup-chrome v2 resolves stable from Chrome for Testing rather than the official installer, so the ci.yml comment about the action's default no longer held.
108 lines
2.7 KiB
YAML
108 lines
2.7 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag to release (e.g. v0.0.1-rc1). Must already exist."
|
|
required: true
|
|
type: string
|
|
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
release-npm:
|
|
name: Publish @sanderling/spec to npm
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ inputs.tag || github.ref }}
|
|
|
|
- name: Resolve version
|
|
id: ver
|
|
run: |
|
|
raw="${{ inputs.tag || github.ref_name }}"
|
|
echo "version=${raw#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Node 22
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: "22"
|
|
registry-url: "https://registry.npmjs.org"
|
|
cache: npm
|
|
cache-dependency-path: pkg/spec/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: pkg/spec
|
|
run: npm ci
|
|
|
|
- name: Stamp version
|
|
working-directory: pkg/spec
|
|
run: npm version ${{ steps.ver.outputs.version }} --no-git-tag-version --allow-same-version
|
|
|
|
- name: Publish
|
|
working-directory: pkg/spec
|
|
# npm tag pre-releases (e.g. 0.1.0-rc1) as "next" so npm install @sanderling/spec
|
|
# keeps resolving the latest stable.
|
|
run: |
|
|
if [[ "${{ steps.ver.outputs.version }}" == *-* ]]; then
|
|
npm publish --access public --tag next
|
|
else
|
|
npm publish --access public
|
|
fi
|
|
|
|
release-cli:
|
|
name: Publish sanderling CLI to GitHub Releases
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ inputs.tag || github.ref }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "17"
|
|
|
|
- name: Set up Android SDK
|
|
uses: android-actions/setup-android@v4
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
|
|
- name: Build sidecar JAR
|
|
run: make sidecar
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: "~> v2"
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|