From 0b6d870bdcbb29d1ffa9fd7717ce296d3fb7812c Mon Sep 17 00:00:00 2001 From: jvegalo Date: Sat, 24 Jun 2023 11:48:01 -0400 Subject: [PATCH 01/18] feat: test on merge action --- .github/workflows/continuous-integration.yml | 16 ++++++++++++++ .github/workflows/coverage.yml | 23 -------------------- .github/workflows/deploy-to-svn.yml | 18 --------------- 3 files changed, 16 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .github/workflows/coverage.yml delete mode 100644 .github/workflows/deploy-to-svn.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..f4a374d --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,16 @@ +name: Continuous Integration + +on: + pull_request: + branches: + - continuous-integration-workflow + types: + - closed + +jobs: + if-merged: + if: ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + steps: + - run: | + echo The PR was merged diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index b3d1fe8..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Coverage - -on: [push] - -jobs: - build-test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: php-actions/composer@v6 - - - name: PHPUnit Tests - uses: php-actions/phpunit@v3 - with: - php_extensions: xdebug - bootstrap: vendor/autoload.php - configuration: test/phpunit.xml - args: --coverage-text - env: - XDEBUG_MODE: coverage - TEST_NAME: Scarlett diff --git a/.github/workflows/deploy-to-svn.yml b/.github/workflows/deploy-to-svn.yml deleted file mode 100644 index 4fa2070..0000000 --- a/.github/workflows/deploy-to-svn.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Deploy To SVN - -on: - push: - tags: - - "*.*.*" -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - name: Deploy - run: chmod +x ./deploy.sh && ./deploy.sh - env: - SVN_USERNAME: ${{ openedx-woocommerce }} - SVN_PASSWORD: ${{ CodebullsEdunext*34 }} From 58d414ff6b24ed54c642fcccd06c6dc960e02fd3 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Sat, 24 Jun 2023 11:50:36 -0400 Subject: [PATCH 02/18] fix: syntax error in yaml --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f4a374d..c9c0778 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,8 +1,8 @@ -name: Continuous Integration +name: "Continuous Integration" on: pull_request: - branches: + branches: - continuous-integration-workflow types: - closed From ed801d008d5a6787397647eca114de7e5e306efe Mon Sep 17 00:00:00 2001 From: Jose Miguel Vega Date: Sat, 24 Jun 2023 10:59:01 -0500 Subject: [PATCH 03/18] test: test onMerge workflow (#9) --- test/HelloTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/HelloTest.php b/test/HelloTest.php index 69d6fbd..5762ebb 100644 --- a/test/HelloTest.php +++ b/test/HelloTest.php @@ -1,6 +1,7 @@ Date: Sat, 24 Jun 2023 12:24:59 -0400 Subject: [PATCH 04/18] test: gest last release --- .github/workflows/continuous-integration.yml | 33 +++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c9c0778..f4d74e6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,16 +1,27 @@ name: "Continuous Integration" on: - pull_request: - branches: - - continuous-integration-workflow - types: - - closed + push: + branches: continuous-integration-workflow jobs: - if-merged: - if: ${{ github.event.pull_request.merged }} - runs-on: ubuntu-latest - steps: - - run: | - echo The PR was merged + compute-stable-branches: + name: Compute current and next stable release branches + runs-on: ubuntu-latest + + steps: + - name: Get current and next stable release branches + id: get_branches + run: | + curl \ + -H "Accept: application/vnd.github.v3+json" \ + -o latest.json \ + "https://api.github.com/repos/${{ github.repository }}/releases/latest" + LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) + IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" + echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT + if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then + echo "next_stable_branch=release/$((LATEST_STABLE_MAJOR + 1)).0" >> $GITHUB_OUTPUT + else + echo "next_stable_branch=release/${LATEST_STABLE_MAJOR}.$((LATEST_STABLE_MINOR + 1))" >> $GITHUB_OUTPUT + fi From 875a38427f0ba5ca853ae7e1a8b7b98649b16479 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Sat, 24 Jun 2023 12:34:34 -0400 Subject: [PATCH 05/18] test: get last release --- test/HelloTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/HelloTest.php b/test/HelloTest.php index 5762ebb..dc53b92 100644 --- a/test/HelloTest.php +++ b/test/HelloTest.php @@ -1,7 +1,6 @@ Date: Sat, 24 Jun 2023 12:51:43 -0400 Subject: [PATCH 06/18] test: get last release 2 --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f4d74e6..36a3007 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,6 +18,7 @@ jobs: -o latest.json \ "https://api.github.com/repos/${{ github.repository }}/releases/latest" LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) + echo LATEST_STABLE_TAG IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then From 00c0107dd4ac342f7bb3928c06345dd61b9059e5 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Sat, 24 Jun 2023 13:02:20 -0400 Subject: [PATCH 07/18] test: get last release 3 --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 36a3007..ce26254 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,7 +18,7 @@ jobs: -o latest.json \ "https://api.github.com/repos/${{ github.repository }}/releases/latest" LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) - echo LATEST_STABLE_TAG + echo "${LATEST_STABLE_TAG}" IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then From 04794bb6316adfde1e81ca20fd7824d6e7a0cef0 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Sat, 24 Jun 2023 13:03:33 -0400 Subject: [PATCH 08/18] test: get last release 4 --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ce26254..f4d74e6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,7 +18,6 @@ jobs: -o latest.json \ "https://api.github.com/repos/${{ github.repository }}/releases/latest" LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) - echo "${LATEST_STABLE_TAG}" IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then From 46a1aa757a8a107684a227ff432b3d99cf808b44 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 10:56:41 -0400 Subject: [PATCH 09/18] ci: test workflow --- .github/workflows/continuous-integration.yml | 52 ++++++++++++-------- CHANGELOG.md | 0 2 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f4d74e6..b4bf3f4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -3,25 +3,37 @@ name: "Continuous Integration" on: push: branches: continuous-integration-workflow - + jobs: - compute-stable-branches: - name: Compute current and next stable release branches - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest + steps: + - name: Bump version and push tag + - uses: actions/checkout@v3 + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + + - name: Create Artifact + run: | + mkdir plugin-build + composer archive -vvv --format=zip --file="plugin-build/OpenEDX WooCommerce Plugin" - steps: - - name: Get current and next stable release branches - id: get_branches - run: | - curl \ - -H "Accept: application/vnd.github.v3+json" \ - -o latest.json \ - "https://api.github.com/repos/${{ github.repository }}/releases/latest" - LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) - IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" - echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT - if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then - echo "next_stable_branch=release/$((LATEST_STABLE_MAJOR + 1)).0" >> $GITHUB_OUTPUT - else - echo "next_stable_branch=release/${LATEST_STABLE_MAJOR}.$((LATEST_STABLE_MINOR + 1))" >> $GITHUB_OUTPUT - fi + -name: Upload Artifact to release + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "*.md;*.zip;random-name-*.txt" + delete_file: "random-name-*.txt;random-*.txt" + release_id: ${{ steps.create_release.outputs.id }} + overwrite: true + verbose: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 From 7ccc2ec7d9ed8da6c2660cda8d9054f888363307 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:00:54 -0400 Subject: [PATCH 10/18] ci: test workflow 2 --- .github/workflows/continuous-integration.yml | 63 ++++++++++---------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b4bf3f4..3b9b210 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,39 +1,40 @@ name: "Continuous Integration" on: - push: - branches: continuous-integration-workflow + push: + branches: + -continuous-integration-workflow jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Bump version and push tag - - uses: actions/checkout@v3 - id: tag_version - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + build: + runs-on: ubuntu-latest + steps: + - name: Bump version and push tag + - uses: actions/checkout@v3 + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Create a GitHub release - uses: ncipollo/release-action@v1 - with: - tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} - - name: Create Artifact - run: | - mkdir plugin-build - composer archive -vvv --format=zip --file="plugin-build/OpenEDX WooCommerce Plugin" + - name: Create Artifact + run: | + mkdir plugin-build + composer archive -vvv --format=zip --file="plugin-build/OpenEDX WooCommerce Plugin" - -name: Upload Artifact to release - uses: xresloader/upload-to-github-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - file: "*.md;*.zip;random-name-*.txt" - delete_file: "random-name-*.txt;random-*.txt" - release_id: ${{ steps.create_release.outputs.id }} - overwrite: true - verbose: true + -name: Upload Artifact to release + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "*.md;*.zip;random-name-*.txt" + delete_file: "random-name-*.txt;random-*.txt" + release_id: ${{ steps.create_release.outputs.id }} + overwrite: true + verbose: true From 2e2b029239a5f9db8529e42e5fa79b700f9a2eb4 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:02:16 -0400 Subject: [PATCH 11/18] ci: test workflow 3 --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3b9b210..59a6e20 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,8 +9,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Bump version and push tag - uses: actions/checkout@v3 + - name: Bump version and push tag id: tag_version uses: mathieudutour/github-tag-action@v6.1 with: From f0d1b548403959a3830d3ff9c74a926ce66d86d0 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:04:01 -0400 Subject: [PATCH 12/18] ci: test workflow 4 --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 59a6e20..3201a91 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -15,7 +15,6 @@ jobs: uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Create a GitHub release uses: ncipollo/release-action@v1 with: From 9d8385a914de83be92f37bd592536e1dac840dff Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:07:45 -0400 Subject: [PATCH 13/18] ci: test workflow 5 --- .github/workflows/continuous-integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3201a91..bd59d8a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,9 +1,8 @@ name: "Continuous Integration" - on: push: branches: - -continuous-integration-workflow + - continuous-integration-workflow jobs: build: From 192acb10bcc4d51fb9bd3ae8657586c91c0fa0f4 Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:09:44 -0400 Subject: [PATCH 14/18] ci: test workflow 6 --- .github/workflows/continuous-integration.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bd59d8a..ca10e0a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -5,7 +5,7 @@ on: - continuous-integration-workflow jobs: - build: + bumpversion: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -20,12 +20,10 @@ jobs: tag: ${{ steps.tag_version.outputs.new_tag }} name: Release ${{ steps.tag_version.outputs.new_tag }} body: ${{ steps.tag_version.outputs.changelog }} - - name: Create Artifact run: | mkdir plugin-build composer archive -vvv --format=zip --file="plugin-build/OpenEDX WooCommerce Plugin" - -name: Upload Artifact to release uses: xresloader/upload-to-github-release@v1 env: From 66d82b81031d3345cfc6b913c883fa05d64b730d Mon Sep 17 00:00:00 2001 From: jvegalo Date: Mon, 26 Jun 2023 11:12:46 -0400 Subject: [PATCH 15/18] ci: test workflow 7 --- .github/workflows/continuous-integration.yml | 25 ++++---------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ca10e0a..e306262 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,14 +1,13 @@ -name: "Continuous Integration" +name: Bump version on: push: - branches: + branches: - continuous-integration-workflow - jobs: - bumpversion: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Bump version and push tag id: tag_version uses: mathieudutour/github-tag-action@v6.1 @@ -19,18 +18,4 @@ jobs: with: tag: ${{ steps.tag_version.outputs.new_tag }} name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} - - name: Create Artifact - run: | - mkdir plugin-build - composer archive -vvv --format=zip --file="plugin-build/OpenEDX WooCommerce Plugin" - -name: Upload Artifact to release - uses: xresloader/upload-to-github-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - file: "*.md;*.zip;random-name-*.txt" - delete_file: "random-name-*.txt;random-*.txt" - release_id: ${{ steps.create_release.outputs.id }} - overwrite: true - verbose: true + body: ${{ steps.tag_version.outputs.changelog }} \ No newline at end of file From b60f344417096dd58e02fe589e381e52f44989a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Ramirez=20Giraldo?= <52968528+julianramirez2@users.noreply.github.com> Date: Wed, 5 Jul 2023 13:32:11 -0500 Subject: [PATCH 16/18] fix: ci workflow updated and working --- .github/workflows/continuous-integration.yml | 45 ++++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e306262..b248a27 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,21 +1,58 @@ -name: Bump version +name: Continuous Integration on: push: branches: - - continuous-integration-workflow + - main jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Bump version and push tag id: tag_version uses: mathieudutour/github-tag-action@v6.1 with: + release_branches: main github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Modify tag_version text + id: modify_variable + run: | + variable="${{ steps.tag_version.outputs.new_tag }}" + modified_variable=$(echo "$variable" | sed -E 's/(v[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "::set-output name=modified_variable::$modified_variable" + - name: Create a GitHub release uses: ncipollo/release-action@v1 + id: create_release with: tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} \ No newline at end of file + name: Release ${{ steps.modify_variable.outputs.modified_variable }} + body: ${{ steps.tag_version.outputs.changelog }} + + - name: Update version in PHP file + run: | + VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') + sed -i "s/Version: *[0-9.]*/Version: $VERSION/g" openedx-woocommerce-plugin.php + + - name: Update version in README + run: | + VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') + sed -i "s/Stable tag: *[0-9.]*/Stable tag: $VERSION/g" README.txt + + - name: Append release info to CHANGELOG.md + run: | + echo "## Release ${{ steps.modify_variable.outputs.modified_variable }}" >> CHANGELOG.md + echo "${{ steps.tag_version.outputs.changelog }}" >> CHANGELOG.md + + - name: Commit and push changes to CHANGELOG.md + run: | + git config --local user.email "jramirezg@eafit.edu.com" + git config --local user.name "GitHub Actions" + git add openedx-woocommerce-plugin.php + git add CHANGELOG.md + git add README.txt + git commit -m "Update release info" + git push From 232a89ac688f5b573b74ff8e9c8038bb204b2078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Ramirez=20Giraldo?= <52968528+julianramirez2@users.noreply.github.com> Date: Wed, 5 Jul 2023 13:37:42 -0500 Subject: [PATCH 17/18] fix: changelog initial commit --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29..2b3f485 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +## Release v1.0.0 +## [1.0.0](https://github.com/eduNEXT/openedx-woocommerce-plugin/compare/v1.0.0...v1.0.0) (2023-07-05) + + +### Features + +* initial commit ([28de3be](https://github.com/eduNEXT/openedx-woocommerce-plugin/commit/28de3be9ff181986c84f5fef9c9ee1e6fa3706dd)) From 9768999e385ab8efb85c937f34af88f01e3e3e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Ramirez=20Giraldo?= <52968528+julianramirez2@users.noreply.github.com> Date: Wed, 5 Jul 2023 17:47:37 -0500 Subject: [PATCH 18/18] fix: new configuration for ci workflow --- .github/workflows/continuous-integration.yml | 98 +++++++++++++------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b248a27..72738a6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,55 +4,81 @@ on: branches: - main jobs: - build: + bumpversion: runs-on: ubuntu-latest + outputs: + version: ${{ steps.tag_version.outputs.new_version }} + previous_tag: ${{ steps.tag_version.outputs.previous_tag }} + bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }} steps: - uses: actions/checkout@v2 - - name: Bump version and push tag + - name: Get next version id: tag_version uses: mathieudutour/github-tag-action@v6.1 with: - release_branches: main github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: false + default_prerelease_bump: false + dry_run: true - - name: Modify tag_version text - id: modify_variable - run: | - variable="${{ steps.tag_version.outputs.new_tag }}" - modified_variable=$(echo "$variable" | sed -E 's/(v[0-9]+\.[0-9]+\.[0-9]+).*/\1/') - echo "::set-output name=modified_variable::$modified_variable" + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "Version: *[0-9.]*" + replace: "Version: ${{ steps.tag_version.outputs.new_version }}" + include: "openedx-woocommerce-plugin.php" + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "Stable tag: *[0-9.]*" + replace: "Stable tag: ${{ steps.tag_version.outputs.new_version }}" + include: "README.txt" + + - name: Update Changelog + if: steps.tag_version.outputs.new_version + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ steps.tag_version.outputs.new_tag }} + release-notes: ${{ steps.tag_version.outputs.changelog }} + + - name: Commit bumpversion + id: bumpversion + if: steps.tag_version.outputs.new_version + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: ${{ github.ref }} + commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_tag }}" + file_pattern: README.txt CHANGELOG.md openedx-woocommerce-plugin.php + + release: + needs: bumpversion + if: needs.bumpversion.outputs.version + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag_version.outputs.new_tag }} + changelog: ${{ steps.tag_version.outputs.changelog }} + + steps: + + - uses: actions/checkout@v2 + + - name: Create tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }} + default_bump: false + default_prerelease_bump: false - name: Create a GitHub release + if: steps.tag_version.outputs.new_tag uses: ncipollo/release-action@v1 - id: create_release with: tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.modify_variable.outputs.modified_variable }} + name: Release ${{ steps.tag_version.outputs.new_tag }} body: ${{ steps.tag_version.outputs.changelog }} - - - name: Update version in PHP file - run: | - VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - sed -i "s/Version: *[0-9.]*/Version: $VERSION/g" openedx-woocommerce-plugin.php - - - name: Update version in README - run: | - VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - sed -i "s/Stable tag: *[0-9.]*/Stable tag: $VERSION/g" README.txt - - - name: Append release info to CHANGELOG.md - run: | - echo "## Release ${{ steps.modify_variable.outputs.modified_variable }}" >> CHANGELOG.md - echo "${{ steps.tag_version.outputs.changelog }}" >> CHANGELOG.md - - - name: Commit and push changes to CHANGELOG.md - run: | - git config --local user.email "jramirezg@eafit.edu.com" - git config --local user.name "GitHub Actions" - git add openedx-woocommerce-plugin.php - git add CHANGELOG.md - git add README.txt - git commit -m "Update release info" - git push +