Skip to content

feat: add workflow to build extension artifact #5

feat: add workflow to build extension artifact

feat: add workflow to build extension artifact #5

Workflow file for this run

name: "Build TapToQR Artifact"
on:
workflow_dispatch:
inputs:
VERSION:
description: "The version of the addon to build"
type: string
required: false
workflow_call:
inputs:
VERSION:
description: "The version of the addon to build"
type: string
required: false
push:
branches:
- main
pull_request:
branches:
- main
env:
VERSION: "0.0.0"
jobs:
build-artifact:
name: "Build TapToQR Artifact"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Determine VERSION
id: determine-version
run: |
echo ${{env.VERSION}}
echo "VERSION=${{ github.event.inputs.VERSION || 'default-version' }}" >> $GITHUB_ENV
echo ${{env.VERSION}}
- name: Install dependencies
run: npm install
- name: Lint code
run: npm run lint
- name: Webpack project
run: npm run webpack-prod
- name: Create Artifact
run: |
cd addon
zip -r ../TapToQR-${{env.VERSION}}.zip ./*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: 'TapToQR-${{env.VERSION}}.zip'
name: 'TapToQR-addon'