1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-11-25 09:43:33 +03:00

Simplify layered workflows around version string generation (#30865)

* Add reusable build workflow

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch to composite action

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Make checkout happier

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Hoist upload artifact

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* copy pasta

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Description

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Simplify

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix passing env

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-09-24 17:09:13 +01:00
committed by GitHub
parent 15af27b906
commit 2f238ed300
4 changed files with 9 additions and 28 deletions

View File

@@ -10,8 +10,7 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }} cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# develop pushes and repository_dispatch handled in build_develop.yaml # develop pushes and repository_dispatch handled in build_develop.yaml
env: env:
# These must be set for fetchdep.sh to get the right branch # This must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
permissions: {} # No permissions required permissions: {} # No permissions required
jobs: jobs:
@@ -56,15 +55,7 @@ jobs:
- run: yarn config set network-timeout 300000 - run: yarn config set network-timeout 300000
- name: Fetch layered build - name: Fetch layered build
id: layered_build run: ./scripts/layered.sh
env:
# tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
run: |
scripts/layered.sh
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD)
echo "VERSION=$VECTOR_SHA--js-$JSSDK_SHA" >> $GITHUB_OUTPUT
- name: Copy config - name: Copy config
run: cp element.io/develop/config.json config.json run: cp element.io/develop/config.json config.json
@@ -72,9 +63,7 @@ jobs:
- name: Build - name: Build
env: env:
CI_PACKAGE: true CI_PACKAGE: true
VERSION: "${{ steps.layered_build.outputs.VERSION }}" run: VERSION=$(scripts/get-version-from-git.sh) yarn build
run: |
yarn build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4

View File

@@ -60,15 +60,10 @@ jobs:
node-version: "lts/*" node-version: "lts/*"
- name: Fetch layered build - name: Fetch layered build
id: layered_build
env: env:
# tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one # tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
run: | run: scripts/layered.sh
scripts/layered.sh
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD)
echo "VERSION=$VECTOR_SHA--js-$JSSDK_SHA" >> $GITHUB_OUTPUT
- name: Copy config - name: Copy config
run: cp element.io/develop/config.json config.json run: cp element.io/develop/config.json config.json
@@ -76,9 +71,7 @@ jobs:
- name: Build - name: Build
env: env:
CI_PACKAGE: true CI_PACKAGE: true
VERSION: "${{ steps.layered_build.outputs.VERSION }}" run: VERSION=$(scripts/get-version-from-git.sh) yarn build
run: |
yarn build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4

View File

@@ -12,8 +12,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
# These must be set for fetchdep.sh to get the right branch # This must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
permissions: {} # No permissions required permissions: {} # No permissions required

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Echoes a version based on the git hashes of the element-web, react-sdk & js-sdk checkouts, for the case where # Echoes a version based on the git hashes of the element-web & js-sdk checkouts, for the case where
# these dependencies are git checkouts. # these dependencies are git checkouts.
set -e set -e
# Since the deps are fetched from git, we can rev-parse # Since the deps are fetched from git & linked, we can rev-parse
JSSDK_SHA=$(git -C node_modules/matrix-js-sdk rev-parse --short=12 HEAD) JSSDK_SHA=$(git -C node_modules/matrix-js-sdk rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
echo $VECTOR_SHA-js-$JSSDK_SHA echo "$VECTOR_SHA-js-$JSSDK_SHA"