Skip to content

Fix Polylang filtering of uploaded custom font attachments (#1884) #1511

Fix Polylang filtering of uploaded custom font attachments (#1884)

Fix Polylang filtering of uploaded custom font attachments (#1884) #1511

Workflow file for this run

name: Bump version, build and create release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version files (no release yet)
uses: helsingborg-stad/release-wp-plugin-action@main
with:
php-version: 8.2
node-version: 24.3.0
skip-release: true # custom flag you added
- name: Pull latest main with bumped version
run: |
git fetch origin main
git checkout main
git pull origin main
git checkout -B release
- name: Extract version
id: version
run: |
VERSION=$(jq -r '.version' package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
# --- PHP Build ---
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: Configure npm for GitHub Packages in root
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
echo "@helsingborg-stad:registry=https://npm.pkg.github.com" >> .npmrc
- name: Configure npm for GitHub Packages for Modularity
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ./Modularity/.npmrc
echo "@helsingborg-stad:registry=https://npm.pkg.github.com" >> ./Modularity/.npmrc
- name: Run PHP build script
run: php build.php --no-composer --cleanup --release
- name: Remove cached git files
run: |
git rm -r --cached .
- name: Overwrite .gitignore for release branch
run: |
cat > .gitignore <<'EOF'
/*
!screenshot.png
!style.css
!.gitignore
!/dist
!/dist/**
!/source/php
!/source/php/**
!views/
!views/**
!views/v3/
!views/v3/**
!/assets
!/assets/**
!/languages
!/languages/**
!/composer.json
!/functions.php
!/library
!/library/**
!/index.php
!/Modularity
Modularity/*
!/Modularity/source
!/Modularity/source/**
!/Modularity/assets/
!/Modularity/assets/**
!/Modularity/modularity.php
!/Modularity/Public.php
!/Modularity/templates
!/Modularity/templates/**
EOF
# --- Release Branch Commit ---
- name: Commit and push release branch
run: |
git config user.name "CI Release Bot"
git config user.email "[email protected]"
git add .
git commit -m "Release build from $GITHUB_SHA" || echo "No changes to commit"
git push origin release --force
# --- Tag and create GitHub Release on release branch ---
- name: Create and push tag
run: |
TAG="${{ steps.version.outputs.version }}"
# skip if tag already exists
if git ls-remote --tags origin | grep -q "refs/tags/$TAG$"; then
echo "Tag $TAG already exists, skipping tag creation."
exit 0
fi
git tag "$TAG"
git push origin "$TAG"
- name: Wait for tag propagation
run: sleep 5
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.version.outputs.version }}
generateReleaseNotes: true