mirror of
https://ghproxy.net/https://github.com/fairpm/fair-plugin.git
synced 2025-09-06 05:13:03 +08:00
Initial export of the repository
Signed-off-by: Ryan McCue <me@ryanmccue.info>
This commit is contained in:
commit
583d434505
76 changed files with 39023 additions and 0 deletions
68
.github/workflows/generate-pot-pr.yml
vendored
Normal file
68
.github/workflows/generate-pot-pr.yml
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
name: Generate POT PR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
generate-pot:
|
||||
name: Generate POT PR
|
||||
if: github.repository == ${{ github.event.repository.full_name }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up PHP environment
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: "7.4"
|
||||
|
||||
- name: Setup WP-CLI
|
||||
uses: godaddy-wordpress/setup-wp-cli@1
|
||||
|
||||
- name: Configure git user
|
||||
run: |
|
||||
git config user.name ${{ github.actor }}
|
||||
git config user.email ${{ github.actor }}@users.noreply.github.com
|
||||
|
||||
- name: Check if remote branch exists
|
||||
run: echo "REMOTE_BRANCH_EXISTS=$([[ -z $(git ls-remote --heads origin generate-pot) ]] && echo "0" || echo "1")" >> $GITHUB_ENV
|
||||
|
||||
- name: Create branch to base pull request on
|
||||
if: env.REMOTE_BRANCH_EXISTS == 0
|
||||
run: |
|
||||
git checkout -b generate-pot
|
||||
|
||||
- name: Fetch existing branch to add commits to
|
||||
if: env.REMOTE_BRANCH_EXISTS == 1
|
||||
run: |
|
||||
git fetch --all --prune
|
||||
git checkout generate-pot
|
||||
git pull --no-rebase
|
||||
|
||||
- name: Generate POT
|
||||
run: |
|
||||
wp i18n make-pot . "./languages/${{ github.event.repository.name }}.pot" --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.event.repository.full_name }}/issues"}'
|
||||
|
||||
- name: Check if there are changes
|
||||
run: echo "CHANGES_DETECTED=$([[ -z $(git status --porcelain) ]] && echo "0" || echo "1")" >> $GITHUB_ENV
|
||||
|
||||
- name: Commit changes
|
||||
if: env.CHANGES_DETECTED == 1
|
||||
run: |
|
||||
git add "./languages/${{ github.event.repository.name }}.pot"
|
||||
git commit -s -m "Generate POT - $(date +'%Y-%m-%d')"
|
||||
git push origin generate-pot
|
||||
|
||||
- name: Create pull request
|
||||
if: env.CHANGES_DETECTED == 1 && env.REMOTE_BRANCH_EXISTS == 0
|
||||
run: gh pr create --base ${BRANCH_NAME} --head generate-pot --title "Generate POT - $(date +'%Y-%m-%d')" --body "Automated PR"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
43
.github/workflows/releases.yml
vendored
Normal file
43
.github/workflows/releases.yml
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
|
||||
name: Upload Release Asset
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Upload Release Asset
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
attestations: write
|
||||
id-token: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Get tag
|
||||
id: tag
|
||||
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build project
|
||||
run: git archive -o /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip --prefix=${{ github.event.repository.name }}/ ${{ steps.tag.outputs.tag }}
|
||||
|
||||
- name: Create WP distribution files
|
||||
run: bin/bundle.sh
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: |
|
||||
/tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip
|
||||
/tmp/fair-dist/*
|
||||
|
||||
- name: Build provenance attestation
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip
|
32
.github/workflows/update-browserslist.yaml
vendored
Normal file
32
.github/workflows/update-browserslist.yaml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Update browserslist regex
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * 1" # Every Monday at midnight
|
||||
|
||||
jobs:
|
||||
update-browserslist-regex:
|
||||
name: Update browserslist regex
|
||||
if: github.repository == ${{ github.event.repository.full_name }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Update browserslist
|
||||
run: ./bin/update-browsers.sh
|
||||
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
branch: update-browserslist
|
||||
commit-message: "Update browser regex from browserslist"
|
||||
title: "[browserslist] Update browser regex"
|
||||
body: "Automated update of browser regex from browserslist."
|
||||
base: main
|
||||
signoff: true
|
||||
delete-branch: true
|
Loading…
Add table
Add a link
Reference in a new issue