Skip to content

generoi/github-action-update-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

github-workflows-plugins

Plugin examples

Gravityforms

Gravityforms
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/gravityforms-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'gravityforms'

FacetWP

FacetWP
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/facetwp-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'facetwp'
      host: 'example.com'
FacetWP - Multilingual support
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/facetwp-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'facetwp-i18n'
      host: 'example.com'

EDD plugins

Note that a license need to be manually activated before it's available for downloading new versions. Happy to accept a PR that activates it automatically but for now it's a manual step.

Polylang PRO
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/edd-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'Polylang Pro'
      source_url: 'https://example.com'
      endpoint_url: 'https://polylang.pro'
Polylang for WooCommerce
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/edd-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'Polylang for WooCommerce'
      source_url: 'https://example.com'
      endpoint_url: 'https://polylang.pro'
      changelog_extract: >-
        '/[0-9\\.]+ \\(.*\\)/ { if (p) { exit }; if ($1 == ver) { p=1; next } } p && NF'
WP All Import
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/edd-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      method: 'GET'
      slug: 'WP All Import'
      source_url: 'https://example.com'
      endpoint_url: 'https://update.wpallimport.com/check_version'

Advanced Custom Fields

Advanced Custom Fields PRO
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/acf-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}

WooCommerce.com

You can retrieve the needed access tokens with wp option get woocommerce_helper_data

WooCommerce Subscriptions
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'woocommerce-subscriptions'
WooCommerce Product Add-Ons
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'woocommerce-product-addons'
WooCommerce Gift Cards
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'woocommerce-gift-cards'
WooCommerce Request a Quote
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'woocommerce-request-a-quote'
WooCommerce all Products for Subscriptions
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'woocommerce-all-products-for-subscriptions'
Role Based Pricing for WooCommerce
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wccom-update.yml@master
    secrets:
      ACCESS_TOKEN: ${{ secrets.WCCOM_ACCESS_TOKEN }}
      ACCESS_TOKEN_SECRET: ${{ secrets.WCCOM_ACCESS_TOKEN_SECRET }}
    with:
      slug: 'role-based-pricing-for-woocommerce'

WPML

Sitepress Multilingual CMS (wpml.org)
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wpml-update.yml@master
    secrets:
      USER_ID: ${{ secrets.USER_ID }}
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'sitepress-multilingual-cms'
WPML String Translation (wpml.org)
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/wpml-update.yml@master
    secrets:
      USER_ID: ${{ secrets.USER_ID }}
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
    with:
      slug: 'wpml-string-translation'

Markup.fi

WooCommerce Carrier Agents / Notuopistehaku
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/markup-update.yml@master
    with:
      slug: 'woocommerce-noutopistehaku'
      source_url: https://example.com
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
Woo Printables / Woo Kuitti
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/markup-update.yml@master
    with:
      slug: 'woocommerce-kuitti'
      source_url: https://example.com
      changelog_awk_extract: |
        '/[0-9\.]+ \(.*\)/ { if (p) { exit }; if ($1 == ver) { p=1; next } } p && NF' changelog.txt
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
WC Smartship / WooCommerce Smartship Prinetti
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/markup-update.yml@master
    with:
      slug: 'woocommerce-smartship-prinetti'
      source_url: https://example.com
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
WC Paytrail (public repository)
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/markup-update.yml@master
    with:
      slug: 'woocommerce-paytrail'

Manual package retrieval examples

WooCommerce Gateway Verifone (zip within a zip)
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    name: Update plugin
    runs-on: ubuntu-latest
    permissions:
      contents: write
    outputs:
      updated: ${{ steps.update.outputs.updated }}
      version: ${{ steps.update.outputs.version }}
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Retrieve the latest version number
        run: |
          curl https://www.bluecommerce.fi/wp-content/uploads/verifone_modules/woocommerce/verifone-plugin_woocommerce.zip?ver_time=$(date +%s) > wrapper.zip
          unzip -p wrapper.zip verifone-plugin_woocommerce/woocommerce-gateway-verifone.zip > package.zip
          {
            echo 'LATEST_VERSION<<EOF'
            unzip -p package.zip woocommerce-gateway-verifone/woocommerce-gateway-verifone.php | grep 'Version:' | sed 's/.*: //'
            echo 'EOF'
          } >> "$GITHUB_ENV"
          rm wrapper.zip
          mv package.zip /tmp/package.zip


      - name: Update repo
        uses: generoi/github-action-update-plugins@master
        id: update
        with:
          download_path: /tmp/package.zip
          version: ${{ env.LATEST_VERSION }}
          changelog_extract: |
            awk -v ver=${{ env.LATEST_VERSION }} '/^## / { if (p) { exit }; if ($2 == "["ver"]") { p=1; next } } p && NF' CHANGELOG.md
Kinsta Must-use Plugins (public repository)
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    name: Update plugin
    runs-on: ubuntu-latest
    permissions:
      contents: write
    outputs:
      updated: ${{ steps.update.outputs.updated }}
      version: ${{ steps.update.outputs.version }}
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Retrieve the latest version number
        run: |
          curl "https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip" > package.zip
          {
            echo 'LATEST_VERSION<<EOF'
            unzip -p package.zip kinsta-mu-plugins.php | grep 'Version:' | sed 's/.*: //'
            echo 'EOF'
          } >> "$GITHUB_ENV"
          rm package.zip

      - name: Update repo
        uses: generoi/github-action-update-plugins@master
        id: update
        with:
          download_url: "https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip"
          version: ${{ env.LATEST_VERSION }}
          strip_archive_folder: 'false'
Relevanssi PRO
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    name: Update plugin
    runs-on: ubuntu-latest
    permissions:
      contents: write
    outputs:
      updated: ${{ steps.update.outputs.updated }}
      version: ${{ steps.update.outputs.version }}
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Retrieve the latest version number
        run: |
          curl "https://www.relevanssi.com/update/fetch_latest_version.php?api_key=${{ secrets.LICENSE_KEY }}" --output package.zip
          {
            echo 'LATEST_VERSION<<EOF'
            unzip -p package.zip relevanssi-premium/relevanssi.php | grep 'Version:' | sed 's/.*: //'
            echo 'EOF'
          } >> "$GITHUB_ENV"
          rm package.zip

      - name: Update repo
        uses: generoi/github-action-update-plugins@master
        id: update
        with:
          download_url: "https://www.relevanssi.com/update/get_version.php?api_key=${{ secrets.LICENSE_KEY }}&version=${{ env.LATEST_VERSION }}"
          version: ${{ env.LATEST_VERSION }}
          changelog_extract: |
            awk -v ver=${{ env.LATEST_VERSION }} '/^= / { if (p) { exit }; if ($2 == ver) { p=1; next } } p && NF' readme.txt 2>&1

Automatically rebuild a satis repository

See generoi/packagist for an example.

  1. Add a job to rebuild satis.
  2. Add a job called to trigger the rebuild
  3. Add a job to each repository to trigger the job after a package has been updated
name: Build
on:
  workflow_dispatch:
  schedule:
    - cron: '5 4 * * *'
permissions:
  contents: write
jobs:
  build:
    uses: generoi/github-action-update-plugins/.github/workflows/acf-update.yml@master
    secrets:
      LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
  update-satis:
    needs: build
    if: needs.build.outputs.updated == 'true'
    uses: generoi/packagist/.github/workflows/update.yml@master
    secrets:
      token: ${{ secrets.PACKAGIST_UPDATE_PAT }}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published