Files
kit/.github/workflows/release.yml
T
Ed Zynda f6ddd0b785 ci: add lint job, npm publish pipeline, and update goreleaser config
- CI: add golangci-lint job, target master branch, use Go 1.26
- Release: add workflow_dispatch for npm-only releases, Discord
  notifications, and npm-publish job for @mark3labs/kit
- Goreleaser: upgrade to v2 schema, lowercase archive names,
  structured changelog groups, release header with install instructions
- npm: add package scaffolding with postinstall binary downloader
2026-02-27 18:27:06 +03:00

102 lines
2.9 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: 'Tag to use for npm publish'
required: true
skip_goreleaser:
description: 'Skip goreleaser job (npm-only release)'
type: boolean
default: true
permissions:
contents: write
id-token: write # Required for npm trusted publishing (OIDC)
jobs:
goreleaser:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !inputs.skip_goreleaser }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Send Discord Notification
if: success()
env:
DISCORD_WEBHOOK: ${{ secrets.RELEASES_WEBHOOK }}
TAG_NAME: ${{ github.ref_name }}
RELEASE_URL: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"New Release: $TAG_NAME\",
\"description\": \"A new version of kit has been released!\",
\"color\": 5814783,
\"fields\": [
{
\"name\": \"Version\",
\"value\": \"$TAG_NAME\",
\"inline\": true
},
{
\"name\": \"Repository\",
\"value\": \"[kit](https://github.com/${{ github.repository }})\",
\"inline\": true
}
],
\"footer\": {
\"text\": \"Released via GitHub Actions\"
},
\"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%S.000Z)\",
\"url\": \"$RELEASE_URL\"
}]
}" \
$DISCORD_WEBHOOK
npm-publish:
runs-on: ubuntu-latest
needs: goreleaser
if: ${{ always() && (needs.goreleaser.result == 'success' || needs.goreleaser.result == 'skipped') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Set version from tag
working-directory: npm
run: |
TAG=${{ inputs.tag || github.ref_name }}
VERSION=${TAG#v}
echo "Setting npm version to $VERSION"
npm version $VERSION --no-git-tag-version
- name: Publish to npm
working-directory: npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}