Skip to content

Commit

Permalink
Merge pull request #37 from bold-commerce/opensourcing
Browse files Browse the repository at this point in the history
Updates readme and adds github workflows
  • Loading branch information
CalinR authored Jul 26, 2024
2 parents 90d3b41 + 4d8315b commit 02615b4
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 2 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions .github/workflows/trigger-workflow.yml
Original file line number Diff line number Diff line change
@@ -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"}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 02615b4

Please sign in to comment.