Skip to content

fix: Drop _root flag and show version on its own line in About #88

fix: Drop _root flag and show version on its own line in About

fix: Drop _root flag and show version on its own line in About #88

name: Build Plugin Artifact
on:
push:
branches:
- '**' # Run on all branches
permissions:
contents: read
jobs:
build-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history to access tags
- name: Get version information
id: version
run: |
# Get latest tag (without 'v' prefix)
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
echo "Latest tag: $LATEST_TAG"
# Get short commit SHA (7 characters)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
echo "Short SHA: $SHORT_SHA"
# Build version string: {tag}-{sha}
VERSION="${LATEST_TAG}-${SHORT_SHA}"
echo "Version: $VERSION"
# Export for later steps
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Update version in JSON files
run: |
VERSION="${{ steps.version.outputs.version }}"
echo "Updating version to: $VERSION"
# Update package.json
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
echo "package.json updated"
grep '"version"' package.json | head -1
# Update plugin.json
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" plugin.json
echo "plugin.json updated"
grep '"version"' plugin.json | head -1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build frontend
run: npm run build
- name: Create plugin directory structure
run: |
mkdir -p plugin-build/deck-progress-tracker/backend/src
# Copy backend
cp backend/src/database.py plugin-build/deck-progress-tracker/backend/src/
cp backend/src/steam_data.py plugin-build/deck-progress-tracker/backend/src/
cp backend/src/hltb_service.py plugin-build/deck-progress-tracker/backend/src/
cp backend/src/__init__.py plugin-build/deck-progress-tracker/backend/src/
cp backend/__init__.py plugin-build/deck-progress-tracker/backend/
# Copy other files (with updated versions)
cp -r dist plugin-build/deck-progress-tracker/
cp main.py plugin-build/deck-progress-tracker/
cp plugin.json plugin-build/deck-progress-tracker/
cp package.json plugin-build/deck-progress-tracker/
cp requirements.txt plugin-build/deck-progress-tracker/
cp LICENSE plugin-build/deck-progress-tracker/
cp README.md plugin-build/deck-progress-tracker/
- name: Create VERSION file
run: |
VERSION="${{ steps.version.outputs.version }}"
echo "$VERSION" > plugin-build/deck-progress-tracker/VERSION
echo "VERSION file created with: $VERSION"
- name: Verify directory contents
run: |
echo "=== Plugin directory contents ==="
ls -lah plugin-build/deck-progress-tracker/
echo ""
echo "=== Version in package.json ==="
grep '"version"' plugin-build/deck-progress-tracker/package.json
echo ""
echo "=== Version in plugin.json ==="
grep '"version"' plugin-build/deck-progress-tracker/plugin.json
echo ""
echo "=== VERSION file ==="
cat plugin-build/deck-progress-tracker/VERSION
- name: Upload artifact (GitHub will zip it automatically)
uses: actions/upload-artifact@v4
with:
name: deck-progress-tracker-${{ steps.version.outputs.version }}
path: plugin-build/
retention-days: 90