Skip to content

Commit

Permalink
flag commit push and testing commit push to main, adding vars to vali…
Browse files Browse the repository at this point in the history
…date conditions
  • Loading branch information
bbatist-ban committed Feb 27, 2024
1 parent f8a64d6 commit dc71086
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/template-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
PUBLISH_ARTIFACT: ${{ vars.PUBLISH_ARTIFACT }}
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
DEBUG_MODE: ${{ vars.DEBUG_MODE }}
COMMIT_PUSH: ${{ vars.COMMIT_PUSH }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -64,6 +65,8 @@ jobs:
echo "CONDITION TRUE PUBLISH_ARTIFACT=${{ env.PUBLISH_ARTIFACT == 'true' }}"
echo "CONDITION FALSE PUBLISH_ARTIFACT=${{ env.PUBLISH_ARTIFACT == 'false' }}"
echo "GITHUB_API_URL=${{ env.GITHUB_API_URL }}"
echo "COMMIT_PUSH=${{ env.COMMIT_PUSH }}"
echo "DEBUG_MODE=${{ env.DEBUG_MODE }}"
- name: Install Mix dependencies
if: ${{ ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) }}
Expand All @@ -78,21 +81,22 @@ jobs:
working-directory: Elixir/Konex

- name: Upgrade mix.exs
if: ${{ ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) }}
if: ${{ ( ( env.COMMIT_PUSH == 'true' ) && ( env.RELEASE_VERSION != '' ) ) || ( ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) ) }}
run: sed -i 's/@version \".*\"/@version "${{ env.RELEASE_VERSION }}"/g' mix.exs
working-directory: Elixir/Konex

# - name: Commit And Push version
# if: ${{ ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) }}
# uses: github-actions-x/[email protected]
# with:
# github-token: ${{ env.GITHUB_TOKEN }}
# push-branch: main
# commit-message: '[skip release] Upgrade version to ${{ env.RELEASE_VERSION }}'
# force-add: "true"
# files: mix.exs
# name: Release Bot
# email: [email protected]
# testing
- name: Commit And Push version
if: ${{ ( ( env.COMMIT_PUSH == 'true' ) && ( env.RELEASE_VERSION != '' ) ) || ( ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) ) }}
uses: github-actions-x/[email protected]
with:
github-token: ${{ env.GITHUB_TOKEN }}
push-branch: main
commit-message: '[skip release] Upgrade version to ${{ env.RELEASE_VERSION }}'
force-add: "true"
files: mix.exs
name: Release Bot
email: [email protected]

- name: Publish to HEX
if: ${{ ( env.PUBLISH_ARTIFACT == 'true' ) && ( env.RELEASE_VERSION != '' ) }}
Expand Down

0 comments on commit dc71086

Please sign in to comment.