From ddb6af71a0c76e30645404c4596b246858459eb2 Mon Sep 17 00:00:00 2001 From: Ponlawat W Date: Sat, 4 Nov 2023 12:56:50 +0700 Subject: [PATCH] 1.0.0 - Extracted reusable sub-workflows (#4) Co-authored-by: ponlawat-w --- .github/workflows/ci.yml | 56 +++++++++-- .github/workflows/default-widget-versions.yml | 42 ++++++++ .github/workflows/get-version.yml | 63 ++++++++++++ .github/workflows/pr.yml | 31 ------ .github/workflows/release.yml | 98 ++++--------------- 5 files changed, 170 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/default-widget-versions.yml create mode 100644 .github/workflows/get-version.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8da96c6..f6cb42d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,29 +9,69 @@ on: type: string default: ${{ github.ref }} widget-backgroundcolour-branch: - description: Branch of background colour widget + description: Branch of background colour widget, latest release will be used if not provided type: string default: '' widget-fontface-branch: - description: Branch of font face widget + description: Branch of font face widget, latest release will be used if not provided type: string default: '' widget-fontsize-branch: - description: Branch of font size widget + description: Branch of font size widget, latest release will be used if not provided type: string default: '' widget-textcolour-branch: - description: Branch of text colour widget + description: Branch of text colour widget, latest release will be used if not provided type: string default: '' + outputs: + widget-backgroundcolour-branch: + description: Branch of background colour widget + value: ${{ jobs.set-widget-versions.outputs.widget-backgroundcolour-branch }} + widget-fontface-branch: + description: Branch of font face widget + value: ${{ jobs.set-widget-versions.outputs.widget-fontface-branch }} + widget-fontsize-branch: + description: Branch of font size widget + value: ${{ jobs.set-widget-versions.outputs.widget-fontsize-branch }} + widget-textcolour-branch: + description: Branch of text colour widget + value: ${{ jobs.set-widget-versions.outputs.widget-textcolour-branch }} jobs: + default-widget-versions: + name: Get default widget versions + uses: ./.github/workflows/default-widget-versions.yml + + set-widget-versions: + name: Set widget versions + needs: default-widget-versions + runs-on: ubuntu-latest + outputs: + widget-backgroundcolour-branch: ${{ steps.get-widgets.outputs.WIDGET-BACKGROUNDCOLOUR-BRANCH }} + widget-fontface-branch: ${{ steps.get-widgets.outputs.WIDGET-FONTFACE-BRANCH }} + widget-fontsize-branch: ${{ steps.get-widgets.outputs.WIDGET-FONTSIZE-BRANCH }} + widget-textcolour-branch: ${{ steps.get-widgets.outputs.WIDGET-TEXTCOLOUR-BRANCH }} + steps: + - id: get-widgets + run: | + echo WIDGET-BACKGROUNDCOLOUR-BRANCH="${{ inputs.widget-backgroundcolour-branch || needs.default-widget-versions.outputs.widget-backgroundcolour-branch }}" + echo WIDGET-FONTFACE-BRANCH="${{ inputs.widget-fontface-branch || needs.default-widget-versions.outputs.widget-fontface-branch }}" + echo WIDGET-FONTSIZE-BRANCH="${{ inputs.widget-fontsize-branch || needs.default-widget-versions.outputs.widget-fontsize-branch }}" + echo WIDGET-TEXTCOLOUR-BRANCH="${{ inputs.widget-textcolour-branch || needs.default-widget-versions.outputs.widget-textcolour-branch }}" + echo WIDGET-BACKGROUNDCOLOUR-BRANCH="${{ inputs.widget-backgroundcolour-branch || needs.default-widget-versions.outputs.widget-backgroundcolour-branch }}" >> $GITHUB_OUTPUT + echo WIDGET-FONTFACE-BRANCH="${{ inputs.widget-fontface-branch || needs.default-widget-versions.outputs.widget-fontface-branch }}" >> $GITHUB_OUTPUT + echo WIDGET-FONTSIZE-BRANCH="${{ inputs.widget-fontsize-branch || needs.default-widget-versions.outputs.widget-fontsize-branch }}" >> $GITHUB_OUTPUT + echo WIDGET-TEXTCOLOUR-BRANCH="${{ inputs.widget-textcolour-branch || needs.default-widget-versions.outputs.widget-textcolour-branch }}" >> $GITHUB_OUTPUT + matrix-test: name: Test M${{ (matrix.moodle == 'MOODLE_402_STABLE' && '4.2') || (matrix.moodle == 'MOODLE_403_STABLE' && '4.3') || matrix.moodle }} P${{ matrix.php }} ${{ matrix.db }} runs-on: ubuntu-latest + needs: set-widget-versions + strategy: fail-fast: true matrix: @@ -73,10 +113,10 @@ jobs: php: ${{ matrix.php }} db: ${{ matrix.db }} accessibility-branch: ${{ inputs.accessibility-branch }} - widget-backgroundcolour-branch: ${{ inputs.widget-backgroundcolour-branch }} - widget-fontface-branch: ${{ inputs.widget-fontface-branch }} - widget-fontsize-branch: ${{ inputs.widget-fontsize-branch }} - widget-textcolour-branch: ${{ inputs.widget-textcolour-branch }} + widget-backgroundcolour-branch: ${{ needs.set-widget-versions.outputs.widget-backgroundcolour-branch }} + widget-fontface-branch: ${{ needs.set-widget-versions.outputs.widget-fontface-branch }} + widget-fontsize-branch: ${{ needs.set-widget-versions.outputs.widget-fontsize-branch }} + widget-textcolour-branch: ${{ needs.set-widget-versions.outputs.widget-textcolour-branch }} - name: PHP Lint if: ${{ !cancelled() }} diff --git a/.github/workflows/default-widget-versions.yml b/.github/workflows/default-widget-versions.yml new file mode 100644 index 0000000..e717632 --- /dev/null +++ b/.github/workflows/default-widget-versions.yml @@ -0,0 +1,42 @@ +name: Get Widget Versions +on: + workflow_call: + outputs: + widget-backgroundcolour-branch: + description: Branch name of background colour widget + value: ${{ jobs.widget-versions.outputs.widget-backgroundcolour-branch }} + widget-fontface-branch: + description: Branch name of font face widget + value: ${{ jobs.widget-versions.outputs.widget-fontface-branch }} + widget-fontsize-branch: + description: Branch name of font size widget + value: ${{ jobs.widget-versions.outputs.widget-fontsize-branch }} + widget-textcolour-branch: + description: Branch name of text colour widget + value: ${{ jobs.widget-versions.outputs.widget-textcolour-branch }} +jobs: + widget-versions: + name: Get default widget versions + runs-on: ubuntu-latest + outputs: + widget-backgroundcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION }} + widget-fontface-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTFACE_VERSION }} + widget-fontsize-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTSIZE_VERSION }} + widget-textcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_TEXTCOLOUR_VERSION }} + steps: + - name: Get widget version + id: get-widget-versions + env: + GH_TOKEN: ${{ github.token }} + run: | + echo "WIDGET_BACKGROUNDCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_backgroundcolour)" >> $GITHUB_OUTPUT + echo "WIDGET_FONTFACE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontface)" >> $GITHUB_OUTPUT + echo "WIDGET_FONTSIZE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontsize)" >> $GITHUB_OUTPUT + echo "WIDGET_TEXTCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_textcolour)" >> $GITHUB_OUTPUT + - name: Get widget branch names + id: widget-branches + run: | + echo "WIDGET_BACKGROUNDCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT + echo "WIDGET_FONTFACE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTFACE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT + echo "WIDGET_FONTSIZE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTSIZE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT + echo "WIDGET_TEXTCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_TEXTCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml new file mode 100644 index 0000000..f81c2e2 --- /dev/null +++ b/.github/workflows/get-version.yml @@ -0,0 +1,63 @@ +name: Retrieve Plugin Version from version.php +on: + workflow_call: + inputs: + repository: + type: string + default: ${{ github.repository }} + ref: + type: string + default: '' + outputs: + plugin-component: + description: Plugin component + value: ${{ jobs.get-version.outputs.plugin-component }} + plugin-release: + description: Plugin release + value: ${{ jobs.get-version.outputs.plugin-release }} + plugin-version: + description: Plugin version + value: ${{ jobs.get-version.outputs.plugin-version }} + plugin-requires: + description: Plugin requires + value: ${{ jobs.get-version.outputs.plugin-requires }} + plugin-maturity: + description: Plugin maturity + value: ${{ jobs.get-version.outputs.plugin-maturity }} + plugin-dependencies: + description: Plugin dependencies (JSON text) + value: ${{ jobs.get-version.outputs.plugin-dependencies }} + branch-name: + description: Branch name + value: ${{ jobs.get-version.outputs.branch-name }} +jobs: + get-version: + name: Get plugin version from version.php + runs-on: ubuntu-latest + outputs: + plugin-component: ${{ steps.plugin-info.outputs.PLUGIN_COMPONENT }} + plugin-release: ${{ steps.plugin-info.outputs.PLUGIN_RELEASE }} + plugin-version: ${{ steps.plugin-info.outputs.PLUGIN_VERSION }} + plugin-requires: ${{ steps.plugin-info.outputs.PLUGIN_REQUIRES }} + plugin-maturity: ${{ steps.plugin-info.outputs.PLUGIN_MATURITY }} + plugin-dependencies: ${{ steps.plugin-info.outputs.PLUGIN_DEPENDENCIES }} + branch-name: ${{ steps.get-branch.outputs.BRANCH_NAME }} + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + extensions: + ini-values: max_input_vars=5000 + coverage: none + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + - name: Get plugin information + id: plugin-info + run: php -r 'define("MOODLE_INTERNAL",1);define("MATURITY_ALPHA",50);define("MATURITY_BETA",100);define("MATURITY_RC",150);define("MATURITY_STABLE",200);define("ANY_VERSION","any");$plugin=new stdClass();include_once("version.php");$plugin->maturity!=200&&throw new Exception("Requires plugin maturity to be stable to release!");echo "PLUGIN_COMPONENT=".(isset($plugin->component)?$plugin->component:"")."\nPLUGIN_RELEASE=".(isset($plugin->release)?$plugin->release:"")."\nPLUGIN_VERSION=".(isset($plugin->version)?$plugin->version:"")."\nPLUGIN_REQUIRES=".(isset($plugin->requires)?$plugin->requires:"")."\nPLUGIN_MATURITY=".(isset($plugin->maturity)?$plugin->maturity:"")."\nPLUGIN_DEPENDENCIES=".(isset($plugin->dependencies)?json_encode($plugin->dependencies):"{}");' >> $GITHUB_OUTPUT + - name: Get branch name + id: get-branch + run: php -r 'echo "BRANCH_NAME=".preg_replace("/(\\(|\\))/", "", strtolower(str_replace(" ", "-", preg_replace("/(\\d+)\\.(\\d+)\\.(\\d+)(.*)/","v$1.$2$4", "${{ steps.plugin-info.outputs.PLUGIN_RELEASE }}"))));' >> $GITHUB_OUTPUT diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b9476a0..3a01e05 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,40 +8,9 @@ on: - reopened - synchronize jobs: - widget-versions: - name: Get default widget versions - runs-on: ubuntu-latest - outputs: - widget-backgroundcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION }} - widget-fontface-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTFACE_VERSION }} - widget-fontsize-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTSIZE_VERSION }} - widget-textcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_TEXTCOLOUR_VERSION }} - steps: - - name: Get widget version - id: get-widget-versions - env: - GH_TOKEN: ${{ github.token }} - run: | - echo "WIDGET_BACKGROUNDCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_backgroundcolour)" >> $GITHUB_OUTPUT - echo "WIDGET_FONTFACE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontface)" >> $GITHUB_OUTPUT - echo "WIDGET_FONTSIZE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontsize)" >> $GITHUB_OUTPUT - echo "WIDGET_TEXTCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_textcolour)" >> $GITHUB_OUTPUT - - name: Get widget branch names - id: widget-branches - run: | - echo "WIDGET_BACKGROUNDCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_FONTFACE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTFACE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_FONTSIZE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTSIZE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_TEXTCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_TEXTCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT ci: name: CI - needs: widget-versions uses: ./.github/workflows/ci.yml - with: - widget-backgroundcolour-branch: ${{ needs.widget-versions.outputs.widget-backgroundcolour-branch }} - widget-fontface-branch: ${{ needs.widget-versions.outputs.widget-fontface-branch }} - widget-fontsize-branch: ${{ needs.widget-versions.outputs.widget-fontsize-branch }} - widget-textcolour-branch: ${{ needs.widget-versions.outputs.widget-textcolour-branch }} pr-ci-finished: name: PR CI Finished needs: ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08d83a2..43f9c65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,116 +7,60 @@ on: jobs: - widget-versions: - name: Get default widget versions - runs-on: ubuntu-latest - outputs: - widget-backgroundcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION }} - widget-fontface-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTFACE_VERSION }} - widget-fontsize-branch: ${{ steps.widget-branches.outputs.WIDGET_FONTSIZE_VERSION }} - widget-textcolour-branch: ${{ steps.widget-branches.outputs.WIDGET_TEXTCOLOUR_VERSION }} - steps: - - name: Get widget version - id: get-widget-versions - env: - GH_TOKEN: ${{ github.token }} - run: | - echo "WIDGET_BACKGROUNDCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_backgroundcolour)" >> $GITHUB_OUTPUT - echo "WIDGET_FONTFACE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontface)" >> $GITHUB_OUTPUT - echo "WIDGET_FONTSIZE_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_fontsize)" >> $GITHUB_OUTPUT - echo "WIDGET_TEXTCOLOUR_VERSION_JSON=$(gh release view --json name -R ponlawat-w/moodle-accessibility_textcolour)" >> $GITHUB_OUTPUT - - name: Get widget branch names - id: widget-branches - run: | - echo "WIDGET_BACKGROUNDCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_BACKGROUNDCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_FONTFACE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTFACE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_FONTSIZE_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_FONTSIZE_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - echo "WIDGET_TEXTCOLOUR_VERSION=v${{ fromJson(steps.get-widget-versions.outputs.WIDGET_TEXTCOLOUR_VERSION_JSON).name }}" >> $GITHUB_OUTPUT - ci: name: CI - needs: widget-versions uses: ./.github/workflows/ci.yml - with: - widget-backgroundcolour-branch: ${{ needs.widget-versions.outputs.widget-backgroundcolour-branch }} - widget-fontface-branch: ${{ needs.widget-versions.outputs.widget-fontface-branch }} - widget-fontsize-branch: ${{ needs.widget-versions.outputs.widget-fontsize-branch }} - widget-textcolour-branch: ${{ needs.widget-versions.outputs.widget-textcolour-branch }} + + get-version: + name: Get version info + uses: ./.github/workflows/get-version.yml push-branches: name: Push to release branches - - needs: [widget-versions, ci] - + needs: [ci, get-version] outputs: - release: ${{ steps.plugin-info.outputs.PLUGIN_RELEASE }} - version: ${{ steps.plugin-info.outputs.PLUGIN_VERSION }} - branch-no-widgets: ${{ steps.get-branch.outputs.BRANCH_NAME }} - branch-with-widgets: ${{ steps.get-branch.outputs.BRANCH_NAME }}-with-widgets - + release: ${{ needs.get-version.outputs.plugin-release }} + version: ${{ needs.get-version.outputs.plugin-version }} + branch-no-widgets: ${{ needs.get-version.outputs.branch-name }} + branch-with-widgets: ${{ needs.get-version.outputs.branch-name }}-with-widgets runs-on: ubuntu-latest steps: - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.0 - extensions: - ini-values: max_input_vars=5000 - coverage: none - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - - name: Get plugin information - id: plugin-info - run: php -r 'define("MOODLE_INTERNAL",1);define("MATURITY_ALPHA",50);define("MATURITY_BETA",100);define("MATURITY_RC",150);define("MATURITY_STABLE",200);define("ANY_VERSION","any");$plugin=new stdClass();include_once("version.php");$plugin->maturity!=200&&throw new Exception("Requires plugin maturity to be stable to release!");echo "PLUGIN_COMPONENT=".(isset($plugin->component)?$plugin->component:"")."\nPLUGIN_RELEASE=".(isset($plugin->release)?$plugin->release:"")."\nPLUGIN_VERSION=".(isset($plugin->version)?$plugin->version:"")."\nPLUGIN_REQUIRES=".(isset($plugin->requires)?$plugin->requires:"")."\nPLUGIN_MATURITY=".(isset($plugin->maturity)?$plugin->maturity:"")."\nPLUGIN_DEPENDENCIES=".(isset($plugin->dependencies)?json_encode($plugin->dependencies):"{}");' >> $GITHUB_OUTPUT - - - name: Get branch name - id: get-branch - run: php -r 'echo "BRANCH_NAME=".preg_replace("/(\\(|\\))/", "", strtolower(str_replace(" ", "-", preg_replace("/(\\d+)\\.(\\d+)\\.(\\d+)(.*)/","v$1.$2$4", "${{ steps.plugin-info.outputs.PLUGIN_RELEASE }}"))));' >> $GITHUB_OUTPUT - - name: Push to release branch (without default widgets) run: | - git checkout -b ${{ steps.get-branch.outputs.BRANCH_NAME }} - git push -f -u origin ${{ steps.get-branch.outputs.BRANCH_NAME }} - + git checkout -b ${{ needs.get-version.outputs.branch-name }} + git push -f -u origin ${{ needs.get-version.outputs.branch-name }} - name: Remove .gitignore for default widgets pack run: | git config --global user.name "ponlawat-w" git config --global user.email "ponlawat_w@outlook.co.th" - git checkout -b ${{ steps.get-branch.outputs.BRANCH_NAME }}-with-widgets + git checkout -b ${{ needs.get-version.outputs.branch-name }}-with-widgets rm ./.gitignore git add -A git commit -m 'Removed .gitignore' - - name: 'Checkout Widget: backgroundcolour' uses: actions/checkout@v4 with: repository: ponlawat-w/moodle-accessibility_backgroundcolour path: widgets/backgroundcolour - ref: ${{ needs.widget-versions.outputs.widget-backgroundcolour-branch }} + ref: ${{ needs.ci.outputs.widget-backgroundcolour-branch }} - name: 'Checkout Widget: fontface' uses: actions/checkout@v4 with: repository: ponlawat-w/moodle-accessibility_fontface path: widgets/fontface - ref: ${{ needs.widget-versions.outputs.widget-fontface-branch }} + ref: ${{ needs.ci.outputs.widget-fontface-branch }} - name: 'Checkout Widget: fontsize' uses: actions/checkout@v4 with: repository: ponlawat-w/moodle-accessibility_fontsize path: widgets/fontsize - ref: ${{ needs.widget-versions.outputs.widget-fontsize-branch }} + ref: ${{ needs.ci.outputs.widget-fontsize-branch }} - name: 'Checkout Widget: textcolour' uses: actions/checkout@v4 with: repository: ponlawat-w/moodle-accessibility_textcolour path: widgets/textcolour - ref: ${{ needs.widget-versions.outputs.widget-textcolour-branch }} - + ref: ${{ needs.ci.outputs.widget-textcolour-branch }} - name: Add widgets run: | rm -rf widgets/backgroundcolour/.git @@ -129,12 +73,10 @@ jobs: rm -rf widgets/textcolour/.github git add -A git commit -m 'Added default widgets' - git push -f -u origin ${{ steps.get-branch.outputs.BRANCH_NAME }}-with-widgets + git push -f -u origin ${{ needs.get-version.outputs.branch-name }}-with-widgets release: - needs: push-branches - strategy: fail-fast: true matrix: @@ -147,31 +89,25 @@ jobs: name: v${{ needs.push-branches.outputs.release }}-with-widgets body: ${{ needs.push-branches.outputs.release }} - ${{ needs.push-branches.outputs.version }} with default widgets delete-branch: true - name: Release ${{ matrix.name }} - runs-on: ubuntu-latest steps: - - name: Checkout uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - - name: Publish Tag run: | git config --global user.name "ponlawat-w" git config --global user.email "ponlawat_w@outlook.co.th" git tag -fa ${{ matrix.name }} -m "${{ matrix.body }}" git push --force origin ${{ matrix.name }} - - name: Release uses: softprops/action-gh-release@v1 with: tag_name: ${{ matrix.name }} name: ${{ matrix.name }} body: ${{ matrix.body }} - - name: Delete branch if: ${{ matrix.delete-branch }} run: git push --force -d origin ${{ matrix.branch }}