Skip to content

Commit

Permalink
Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyc committed Sep 4, 2024
0 parents commit ec2b53d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build
on:
workflow_dispatch:
schedule:
- cron: '5 4 * * *'
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 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' woocommerce-gateway-verifone/CHANGELOG.md
update-satis:
needs: build
if: needs.build.outputs.updated == 'true'
uses: generoi/packagist/.github/workflows/update.yml@master
secrets:
token: ${{ secrets.PACKAGIST_UPDATE_PAT }}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "generoi/woocommerce-gateway-verifone",
"type": "wordpress-plugin",
"homepage": "https://www.bluecommerce.fi/kayttoonotto/woocommerce-moduuli/"
}

0 comments on commit ec2b53d

Please sign in to comment.