From 4d489281242c68e3dbfae97db2d9a835fb1e5ce0 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Tue, 6 Jul 2021 19:00:11 +0530 Subject: Separated version number bump into the 'develop' branch from 'nightly' branch (#1610) * Separated version number bump into the 'develop' branch so that the commit SHA appearing in 'About' will remain unchanged --- .github/workflows/dependency-updates.yml | 32 +++++++++++++++++++++----------- .github/workflows/ferdi-builds.yml | 17 +++++++---------- 2 files changed, 28 insertions(+), 21 deletions(-) (limited to '.github') diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 450ddf8a1..38de90dbd 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -3,6 +3,12 @@ name: Ferdi Dependency updates on: + # Manual trigger from the UI + workflow_dispatch: + inputs: + message: + description: 'Message for build' + required: true schedule: - cron: '0 0 * * *' # every night at 12 am @@ -21,6 +27,9 @@ jobs: with: submodules: recursive fetch-depth: 0 + - name: Extract Git branch name from the currently checked out branch (not from the branch where this run was kicked off) + run: echo "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + shell: bash - name: Cache node modules uses: actions/cache@v2 env: @@ -42,23 +51,24 @@ jobs: npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which node-gyp)" - name: Install node dependencies recursively run: npx lerna bootstrap - - name: Update submodules, dependencies and run tests + - name: Update submodules + run: git submodule update --remote -f + - name: Update browserslist db + run: npx browserslist@latest --update-db + - name: Run linter, reformatter, rebrander and tests run: | - echo "Updating submodules" - git submodule update --remote -f - - echo "Updating browserslist db" - npx browserslist@latest --update-db - - echo "Running linter, reformatter, rebrander and tests" npm run lint npm run reformat-files npm run manage-translations npm run apply-branding npm run test - - echo "Committing and pushing submodules, dependency-updates and linter changes" + - name: Commit submodules, dependency-updates and linter changes + run: | git config user.name github-actions git config user.email github-actions@github.com git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true - git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify + - name: Bump version number if this is a scheduled build or has been manually triggered with 'version bump' in the text, then bump the version number + if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'version bump')) }} + run: npm version prerelease --preid=nightly + - name: Push all changes + run: git push origin ${{ env.GIT_BRANCH_NAME }} --no-verify diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index c2c253011..78c47f74e 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml @@ -5,8 +5,10 @@ # 'FERDI_PUBLISH_TOKEN' (A GitHub Personal Access Token with appropriate permissions - for publishing the built artifacts) # 'APPLEID' (The username of your Apple developer account - for notarizing the mac artifacts) # 'APPLEID_PASSWORD' (An app-specific password - for notarizing the mac artifacts) - # 'CSC_LINK' (The HTTPS link or local path to certificate - for code signing of mac and windows artifacts) - # 'CSC_KEY_PASSWORD' (The password to decrypt the certificate given in CSC_LINK - for code signing of mac and windows artifacts) + # 'CSC_LINK' (The HTTPS link or local path to certificate - for code signing of mac artifacts) + # 'CSC_KEY_PASSWORD' (The password to decrypt the certificate given in CSC_LINK - for code signing of mac artifacts) + # 'WIN_CSC_LINK' (The HTTPS link or local path to certificate - for code signing of windows artifacts) + # 'WIN_CSC_KEY_PASSWORD' (The password to decrypt the certificate given in CSC_LINK - for code signing of windows artifacts) name: Ferdi Builds @@ -51,8 +53,8 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com - echo "Merge from 'origin/develop'" - git merge --no-ff --no-verify --commit -m "Merge remote-tracking branch 'origin/develop' into HEAD" origin/develop + echo "Merge with fast-forward from 'origin/develop'" + git merge --ff-only origin/develop --no-verify CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" @@ -61,12 +63,7 @@ jobs: echo "No changes found - terminating the build" echo "::set-output name=should_run::false" else # changes > 0 (or) MANUAL_REBUILD=true - if [ $MANUAL_REBUILD != "true" ] || [ "${{ contains(github.event.inputs.message, 'version bump') }}" == "true" ]; then - echo "Bumping version number" - npm version prerelease --preid=nightly - fi - - echo "Pushing merge and version-bump commits" + echo "Pushing rebased commits" git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify fi -- cgit v1.2.3-54-g00ecf