Skip to content

Attach helios.js to release #747

Attach helios.js to release

Attach helios.js to release #747

Workflow file for this run

name: Attach helios.js to release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag to build and upload (e.g. v1.1.0)"
required: true
permissions:
contents: write
jobs:
build-and-attach:
runs-on: ubuntu-latest
steps:
- name: Resolve tag
id: tag
run: |
TAG="${{ github.event.release.tag_name || inputs.tag }}"
if [ -z "$TAG" ]; then
echo "::error::No tag resolved"
exit 1
fi
echo "value=$TAG" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ steps.tag.outputs.value }}
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
cache: npm
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Verify artifact
run: |
if [ ! -f dist/helios.js ]; then
echo "::error::dist/helios.js not produced"
ls -la dist/ || true
exit 1
fi
echo "::notice::Built $(stat -c%s dist/helios.js) bytes"
- name: Upload helios.js to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ steps.tag.outputs.value }}" dist/helios.js \
--clobber \
--repo "$GITHUB_REPOSITORY"