diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..bc53005 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,91 @@ +name: Create release + +on: + workflow_dispatch: + inputs: + releaseType: + description: 'Release type' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +permissions: + contents: write + +jobs: + create_release: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + GH_TOKEN: ${{ secrets.CI_BOT_RELEASE_PAT }} + outputs: + new_version: ${{ steps.determine_new_version.outputs.new_version }} + steps: + - uses: actions/checkout@v4 + - name: determine new version + id: determine_new_version + run: | + last_release=`gh release list | head -n 1 | awk '{print $3}'` + release_type=${{ inputs.releaseType }} + echo "Creating new $release_type release after $last_release" + major=`echo $last_release | cut -d v -f 2 | cut -d . -f 1` + minor=`echo $last_release | cut -d . -f 2` + patch=`echo $last_release | cut -d . -f 3` + case $release_type in + major) + major=`expr $major + 1` + minor=0 + patch=0 + ;; + minor) + minor=`expr $minor + 1` + patch=0 + ;; + patch) + patch=`expr $patch + 1` + ;; + esac + new_version=$major.$minor.$patch + echo "New release is $new_version" + echo "new_version=$new_version" >> "$GITHUB_OUTPUT" + + - name: Bump composer.json version + env: + new_version: ${{ steps.determine_new_version.outputs.new_version }} + run: | + echo "New version: $new_version" + git config --global user.email 'github-ci@boldcommerce.com' + git config --global user.name 'bold-github-ci' + branch_exists=`git ls-remote --heads origin refs/heads/release-$new_version | wc -l` + if [[ $branch_exists -eq 0 ]]; + then + echo "Branch does not exist, pushing new release branch" + jq '.version = $version' --arg version $new_version composer.json > composer.new.json + mv composer.new.json composer.json + git checkout -b release-$new_version + git add composer.json + git commit -m 'Bump version number for release' + git push --set-upstream origin release-$new_version + else + echo "Branch exists, using existing branch" + git fetch origin + git checkout release-$new_version + fi + pr_exists=`gh pr list -H release-$new_version | wc -l` + if [[ $pr_exists -eq 0 ]]; + then + echo "Creating new Pull request for release" + gh pr create --title "Create release $new_version" --body "Create new release from workflow" + fi + echo "Merging release pull request" + gh pr merge --admin --squash + + - name: Create github release + env: + new_version: v${{ steps.determine_new_version.outputs.new_version }} + run: | + gh release create --generate-notes --latest $new_version \ No newline at end of file diff --git a/.github/workflows/trigger-workflow.yml b/.github/workflows/trigger-workflow.yml new file mode 100644 index 0000000..82c4be3 --- /dev/null +++ b/.github/workflows/trigger-workflow.yml @@ -0,0 +1,19 @@ +name: Trigger workflow + +on: + push: + branches: + - main + +jobs: + create_release: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Github REST API Call + env: + CI_TOKEN: ${{ secrets.access_token }} + REMOTE_REPO: bold-commerce/magento-2.3-sandbox-store + WORKFLOW_ID: 72597118 + run: | + curl -fL --retry 3 -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ env.CI_TOKEN }}" https://api.github.com/repos/${{ env.REMOTE_REPO }}/actions/workflows/${{ env.WORKFLOW_ID }}/dispatches -d '{"ref":"main"}' \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..090a1f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..5441336 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Bold Commerce + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 26f1796..6376000 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -# Bold Payment Booster +# Adobe Commerce Bold Payment Booster + +This extension adds Bold payment gateways to your existing Adobe Commere checkout experience. + +The Bold Checkout extension supports Adobe Commerce (formerly known as Magento 2) and Magento Open Source stores. + +## Install the Bold Payment Booster extension + +Refer to the develop documentation for [Payment Booster installation instructions](https://developer.boldcommerce.com/guides/platform-integration/adobe-commerce/installation?config=payment-booster). + +## Support + +If you have any questions, reach out to the [Bold Customer Success team](https://support.boldcommerce.com/hc/en-us/requests/new?ticket_form_id=132106). diff --git a/composer.json b/composer.json index 1ae5c6a..2c3cc0f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "bold-commerce/module-checkout-payment-booster", - "description": "N/A", + "description": "Bold Payment Booster integration for Adobe Commerce", "type": "magento2-module", "license": [ "MIT"