Skip to content

fix(changelog): document fix for event translation preserving empty l… #15

fix(changelog): document fix for event translation preserving empty l…

fix(changelog): document fix for event translation preserving empty l… #15

Workflow file for this run

name: Module Release
on:
push:
tags:
- '*@*' # Triggers only if the tag matches the format "module@1.0.0"
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write # Required to create releases and update floating tags
steps:
- uses: actions/checkout@v4
# 1. Clone External Libs
- name: Clone jstls Repository
run: |
# Creates the 'lib' folder by cloning the repo into it
git clone https://github.com/yoimerdr/jstls.git lib/jstls
# 2. Setup PNPM
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.8.0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: '.build/pnpm-lock.yaml'
# 3. Extract Tag Info
- name: Extract Tag Info
id: extract
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
MODULE_NAME=$(echo $TAG_NAME | cut -d'@' -f1)
VERSION=$(echo $TAG_NAME | cut -d'@' -f2)
echo "Processing Module: $MODULE_NAME"
echo "Version: $VERSION"
# Export variables for next steps
echo "module=$MODULE_NAME" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "full_tag=$TAG_NAME" >> $GITHUB_OUTPUT
# 4. Install Build Dependencies
- name: Install Build Dependencies
run: |
cd .build
pnpm install --frozen-lockfile
# 5. Build the Specific Module
- name: Build Module
run: |
echo "Building ${{ steps.extract.outputs.module }}..."
# Essential: Add .build/node_modules to NODE_PATH so the 'typescript' plugin
# (installed in .build) can be resolved while running from the root.
export NODE_PATH=$(pwd)/.build/node_modules
# Execute Rollup using the direct path to the binary (running from ROOT context)
node .build/node_modules/rollup/dist/bin/rollup \
-c .build/${{ steps.extract.outputs.module }}.config.mjs \
--configPlugin typescript \
--bundleConfigAsCjs
# 6. Zip Artifacts (Preserving Folder Structure)
- name: Zip Artifacts
run: |
# Define the output zip name
ZIP_NAME="${{ steps.extract.outputs.module }}-v${{ steps.extract.outputs.version }}.zip"
echo "Creating zip file: $ZIP_NAME"
cd dist
zip -r ../$ZIP_NAME .
# Save the zip filename to the environment variable for the upload step
echo "ZIP_FILE=$ZIP_NAME" >> $GITHUB_ENV
# 7. Create Version Release (Uploading the ZIP)
- name: Create Version Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.extract.outputs.full_tag }}
name: ${{ steps.extract.outputs.module }} v${{ steps.extract.outputs.version }}
# Upload only the zip file generated in the previous step
files: ${{ env.ZIP_FILE }}
draft: false
prerelease: false
# Custom description body
body: |
**Version:** `${{ steps.extract.outputs.version }}`
**Commit:** `${{ github.sha }}`
### Download
Download the **ZIP file** below to get the module with the correct folder structure (e.g. `plugins/`, `min/`).
> _Auto-generated by GitHub Actions._
# 8. Update Floating Tag (Latest)
- name: Update Floating Tag (Latest)
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.extract.outputs.module }}-latest
name: ${{ steps.extract.outputs.module }} (Latest)
files: ${{ env.ZIP_FILE }}
draft: false
prerelease: false
body: |
This release always points to the **most recent** build of the **${{ steps.extract.outputs.module }}** module.
- **Updated at:** ${{ github.event.head_commit.timestamp }}
- **Commit:** `${{ github.sha }}`
For a permanent link to a specific version, please check the [history](../).