mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
ci: publish dist/index.js to GitHub Release on version tag
Triggers on v* tags. Builds with wrangler --dry-run, falls back to dist/worker.js and dist/_worker.js if index.js is not produced. Uploads as index.js so homelab Tofu can fetch a stable URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- name: Locate bundled output
|
||||||
|
id: bundle
|
||||||
|
run: |
|
||||||
|
for f in dist/index.js dist/worker.js dist/_worker.js; do
|
||||||
|
if [ -f "$f" ]; then
|
||||||
|
echo "path=$f" >> "$GITHUB_OUTPUT"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "No bundled output found in dist/" >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Upload to GitHub Release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG_NAME: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
cp "${{ steps.bundle.outputs.path }}" dist/index.js
|
||||||
|
gh release upload "$TAG_NAME" dist/index.js --clobber
|
||||||
Reference in New Issue
Block a user