aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-10-11 08:13:30 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-10-11 08:13:40 +0530
commit59489c0d36f2c8b093f3eb697cd3090431fe6575 (patch)
tree5613d793dd2215609c5516797061060b84a92d76 /.github
parent6.2.1-nightly.15 [skip ci] (diff)
downloadferdium-app-59489c0d36f2c8b093f3eb697cd3090431fe6575.tar.gz
ferdium-app-59489c0d36f2c8b093f3eb697cd3090431fe6575.tar.zst
ferdium-app-59489c0d36f2c8b093f3eb697cd3090431fe6575.zip
Simplify whether to run the build or not
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/builds.yml69
1 files changed, 23 insertions, 46 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
index 9f590de46..8ee21fb7d 100644
--- a/.github/workflows/builds.yml
+++ b/.github/workflows/builds.yml
@@ -71,6 +71,29 @@ jobs:
71 CHANGES_COUNT=$(git diff --shortstat origin/develop | wc -l) 71 CHANGES_COUNT=$(git diff --shortstat origin/develop | wc -l)
72 MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" 72 MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}"
73 VERSION_BUMP="${{ contains(github.event.inputs.message, '[version bump]') }}" 73 VERSION_BUMP="${{ contains(github.event.inputs.message, '[version bump]') }}"
74 if [ $CHANGES_COUNT -gt 0 ]; then
75 # If there were any changes only in the submodules, then...
76
77 echo "Update browserslist db"
78 npx browserslist@latest --update-db
79 git add .
80 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
81
82 echo "Run linter, reformatter, rebrander and tests"
83 npm run prepare-code
84 npm run test
85
86 echo "Commit dependency-updates and linter changes"
87 git config user.name github-actions
88 git config user.email github-actions@github.com
89 git commit -am "Update browserslist data updates and linter fixes [skip ci]" --no-verify || true
90
91 echo "Push all changes"
92 git push origin develop --no-verify
93
94 git checkout nightly
95 fi
96
74 if [ $CHANGES_COUNT -gt 0 ] || [[ $MANUAL_REBUILD == "true" && $VERSION_BUMP == "true" ]]; then 97 if [ $CHANGES_COUNT -gt 0 ] || [[ $MANUAL_REBUILD == "true" && $VERSION_BUMP == "true" ]]; then
75 # Do the version bump in the 'develop' branch ONLY if 98 # Do the version bump in the 'develop' branch ONLY if
76 # there were other changes coming from the 'develop' branch (or) 99 # there were other changes coming from the 'develop' branch (or)
@@ -95,52 +118,6 @@ jobs:
95 git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify 118 git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify
96 fi 119 fi
97 120
98 dependency_updates:
99 name: "Update dependencies"
100 runs-on: ubuntu-20.04
101 needs: check_updates
102 if: ${{ needs.check_updates.outputs.should_run != 'false' }}
103 steps:
104 - name: Set env vars
105 run: |
106 echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV
107 echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV
108 - name: Checkout code along with submodules for the develop branch
109 uses: actions/checkout@v3
110 with:
111 ref: develop
112 submodules: recursive
113 fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging
114 - name: Use Node.js specified in the '.nvmrc' file
115 uses: actions/setup-node@v3
116 with:
117 node-version-file: '.nvmrc'
118 - name: Install npm
119 run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
120 - name: Install pnpm
121 run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
122 - name: Install node dependencies
123 run: npm i
124 - name: Update browserslist db
125 run: |
126 npx browserslist@latest --update-db
127 git add .
128 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
129 - name: Run linter, reformatter, rebrander and tests
130 if: ${{ env.GIT_DIRTY != '0' }}
131 run: |
132 npm run prepare-code
133 npm run test
134 - name: Commit dependency-updates and linter changes
135 if: ${{ env.GIT_DIRTY != '0' }}
136 run: |
137 git config user.name github-actions
138 git config user.email github-actions@github.com
139 git commit -am "Update browserslist data updates and linter fixes [skip ci]" --no-verify || true
140 - name: Push all changes
141 if: ${{ env.GIT_DIRTY != '0' }}
142 run: git push origin develop --no-verify
143
144 build_mac: 121 build_mac:
145 name: "macos ${{ github.event.inputs.message }}" 122 name: "macos ${{ github.event.inputs.message }}"
146 needs: check_updates 123 needs: check_updates