Skip to content

Build

Build #9

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
tag_name:
description: Tag to release, for example v1.2.3
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
- name: Archive dist
run: cd dist && zip -r ../dist.zip .
- name: Upload dist artifact
uses: actions/upload-artifact@v7
with:
name: dist
path: dist
if-no-files-found: error
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ inputs.tag_name }}
run: |
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
gh release edit "$TAG_NAME" \
--draft \
--title "$TAG_NAME" \
--target "$GITHUB_SHA"
gh release upload "$TAG_NAME" dist.zip --clobber
else
gh release create "$TAG_NAME" dist.zip \
--draft \
--title "$TAG_NAME" \
--generate-notes \
--target "$GITHUB_SHA"
fi