From ec2b53d4ae3b23126d3bb9a65c70c834c6486df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Wed, 4 Sep 2024 19:37:42 -0300 Subject: [PATCH] Setup --- .github/.editorconfig | 11 +++++++++ .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ composer.json | 5 ++++ 3 files changed, 62 insertions(+) create mode 100644 .github/.editorconfig create mode 100644 .github/workflows/build.yml create mode 100644 composer.json diff --git a/.github/.editorconfig b/.github/.editorconfig new file mode 100644 index 0000000..dad6b58 --- /dev/null +++ b/.github/.editorconfig @@ -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 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..988d504 --- /dev/null +++ b/.github/workflows/build.yml @@ -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<> "$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 }} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9f9ef8d --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "name": "generoi/woocommerce-gateway-verifone", + "type": "wordpress-plugin", + "homepage": "https://www.bluecommerce.fi/kayttoonotto/woocommerce-moduuli/" +}