Update workflows

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2026-02-24 21:27:04 +00:00
parent 41d6094cc0
commit e84ae7a6d6
12 changed files with 43 additions and 19 deletions
+3 -1
View File
@@ -57,9 +57,11 @@ jobs:
run: ./scripts/layered.sh run: ./scripts/layered.sh
- name: Copy config - name: Copy config
working-directory: apps/web
run: cp element.io/develop/config.json config.json run: cp element.io/develop/config.json config.json
- name: Build - name: Build
working-directory: apps/web
env: env:
CI_PACKAGE: true CI_PACKAGE: true
run: VERSION=$(scripts/get-version-from-git.sh) pnpm build run: VERSION=$(scripts/get-version-from-git.sh) pnpm build
@@ -68,5 +70,5 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with: with:
name: webapp-${{ matrix.image }} name: webapp-${{ matrix.image }}
path: webapp path: apps/web/webapp
retention-days: 1 retention-days: 1
+7 -2
View File
@@ -17,11 +17,13 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download package - name: Download package
working-directory: apps/web
run: | run: |
wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz" wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz"
wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz.asc" wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz.asc"
- name: Check GPG signature - name: Check GPG signature
working-directory: apps/web
run: | run: |
wget "https://packages.element.io/element-release-key.gpg" wget "https://packages.element.io/element-release-key.gpg"
gpg --import element-release-key.gpg gpg --import element-release-key.gpg
@@ -31,6 +33,7 @@ jobs:
FINGERPRINT: ${{ vars.GPG_FINGERPRINT }} FINGERPRINT: ${{ vars.GPG_FINGERPRINT }}
- name: Prepare - name: Prepare
working-directory: apps/web
run: | run: |
mkdir -p debian/tmp/DEBIAN mkdir -p debian/tmp/DEBIAN
find debian -maxdepth 1 -type f -exec cp "{}" debian/tmp/DEBIAN/ \; find debian -maxdepth 1 -type f -exec cp "{}" debian/tmp/DEBIAN/ \;
@@ -41,6 +44,7 @@ jobs:
ln -s /etc/element-web/config.json debian/tmp/usr/share/element-web/config.json ln -s /etc/element-web/config.json debian/tmp/usr/share/element-web/config.json
- name: Write changelog - name: Write changelog
working-directory: apps/web
run: | run: |
VERSION=$(cat package.json | jq -r .version) VERSION=$(cat package.json | jq -r .version)
TIME=$(date -d "$PUBLISHED_AT" -R) TIME=$(date -d "$PUBLISHED_AT" -R)
@@ -57,6 +61,7 @@ jobs:
PUBLISHED_AT: ${{ github.event.release.published_at }} PUBLISHED_AT: ${{ github.event.release.published_at }}
- name: Build deb package - name: Build deb package
working-directory: apps/web
run: | run: |
VERSION=$(cat package.json | jq -r .version) VERSION=$(cat package.json | jq -r .version)
dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog
@@ -65,14 +70,14 @@ jobs:
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with: with:
name: element-web.deb name: element-web.deb
path: element-web.deb path: apps/web/element-web.deb
retention-days: 14 retention-days: 14
- name: Publish to packages.element.io - name: Publish to packages.element.io
if: github.event.release.prerelease == false if: github.event.release.prerelease == false
uses: element-hq/packages.element.io@master uses: element-hq/packages.element.io@master
with: with:
file: element-web.deb file: apps/web/element-web.deb
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
bucket-api: ${{ vars.CF_R2_S3_API }} bucket-api: ${{ vars.CF_R2_S3_API }}
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }} bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
+7 -4
View File
@@ -40,6 +40,7 @@ jobs:
run: "./scripts/layered.sh" run: "./scripts/layered.sh"
- name: Build, Package & Upload sourcemaps - name: Build, Package & Upload sourcemaps
working-directory: apps/web
run: "./scripts/ci_package.sh" run: "./scripts/ci_package.sh"
env: env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
@@ -55,20 +56,22 @@ jobs:
CSP_EXTRA_SOURCE: ${{ env.R2_PUBLIC_URL }} CSP_EXTRA_SOURCE: ${{ env.R2_PUBLIC_URL }}
- run: mv dist/element-*.tar.gz dist/develop.tar.gz - run: mv dist/element-*.tar.gz dist/develop.tar.gz
working-directory: apps/web
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with: with:
name: webapp name: webapp
path: dist/develop.tar.gz path: apps/web/dist/develop.tar.gz
retention-days: 1 retention-days: 1
- name: Extract webapp - name: Extract webapp
run: | run: |
mkdir _deploy mkdir _deploy
tar xf dist/develop.tar.gz -C _deploy --strip-components=1 tar xf apps/web/dist/develop.tar.gz -C _deploy --strip-components=1
- name: Copy config - name: Copy config
run: cp element.io/develop/config.json _deploy/config.json working-directory: apps/web
run: cp apps/web/element.io/develop/config.json _deploy/config.json
- name: Populate 404.html - name: Populate 404.html
run: echo "404 Not Found" > _deploy/404.html run: echo "404 Not Found" > _deploy/404.html
@@ -115,7 +118,7 @@ jobs:
# Checksum algorithm specified as per https://developers.cloudflare.com/r2/examples/aws/aws-cli/ # Checksum algorithm specified as per https://developers.cloudflare.com/r2/examples/aws/aws-cli/
- name: Deploy to R2 - name: Deploy to R2
run: | run: |
aws s3 cp dist/develop.tar.gz s3://$R2_BUCKET/develop.tar.gz --endpoint-url $R2_URL --region=auto --checksum-algorithm CRC32 aws s3 cp apps/web/dist/develop.tar.gz s3://$R2_BUCKET/develop.tar.gz --endpoint-url $R2_URL --region=auto --checksum-algorithm CRC32
aws s3 cp _deploy/ s3://$R2_BUCKET/ --recursive --endpoint-url $R2_URL --region=auto --checksum-algorithm CRC32 aws s3 cp _deploy/ s3://$R2_BUCKET/ --recursive --endpoint-url $R2_URL --region=auto --checksum-algorithm CRC32
env: env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
+1 -1
View File
@@ -70,7 +70,7 @@ jobs:
run: cp -vnpr _current_version/bundles/* _deploy/bundles/ run: cp -vnpr _current_version/bundles/* _deploy/bundles/
- name: Copy config - name: Copy config
run: cp element.io/app/config.json _deploy/config.json run: cp apps/web/element.io/app/config.json _deploy/config.json
- name: Populate 404.html - name: Populate 404.html
run: echo "404 Not Found" > _deploy/404.html run: echo "404 Not Found" > _deploy/404.html
+2
View File
@@ -41,6 +41,7 @@ jobs:
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with: with:
context: . context: .
file: apps/web/Dockerfile
load: true load: true
- name: Test the image - name: Test the image
@@ -151,6 +152,7 @@ jobs:
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: with:
context: . context: .
file: apps/web/Dockerfile
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
+7 -4
View File
@@ -68,18 +68,20 @@ jobs:
run: scripts/layered.sh run: scripts/layered.sh
- name: Copy config - name: Copy config
working-directory: apps/web
run: cp element.io/develop/config.json config.json run: cp element.io/develop/config.json config.json
- name: Build - name: Build
env: env:
CI_PACKAGE: true CI_PACKAGE: true
working-directory: apps/web
run: VERSION=$(scripts/get-version-from-git.sh) pnpm build run: VERSION=$(scripts/get-version-from-git.sh) pnpm build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with: with:
name: webapp name: webapp
path: webapp path: apps/web/webapp
retention-days: 1 retention-days: 1
- name: Calculate runner variables - name: Calculate runner variables
@@ -133,7 +135,7 @@ jobs:
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with: with:
name: webapp name: webapp
path: webapp path: apps/web/webapp
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
@@ -167,6 +169,7 @@ jobs:
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else # We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
- name: Run Playwright tests - name: Run Playwright tests
working-directory: apps/web
run: | run: |
pnpm playwright test \ pnpm playwright test \
--shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \ --shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \
@@ -178,7 +181,7 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with: with:
name: all-blob-reports-${{ matrix.project }}-${{ matrix.runner }} name: all-blob-reports-${{ matrix.project }}-${{ matrix.runner }}
path: blob-report path: apps/web/blob-report
retention-days: 1 retention-days: 1
downstream-modules: downstream-modules:
@@ -225,7 +228,7 @@ jobs:
- name: Merge into HTML Report - name: Merge into HTML Report
if: inputs.skip != true if: inputs.skip != true
run: pnpm playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,@element-hq/element-web-playwright-common/lib/stale-screenshot-reporter.js ./all-blob-reports run: pnpm playwright merge-reports --reporter=html,./apps/web/playwright/flaky-reporter.ts,@element-hq/element-web-playwright-common/lib/stale-screenshot-reporter.js ./all-blob-reports
env: env:
# Only pass creds to the flaky-reporter on main branch runs # Only pass creds to the flaky-reporter on main branch runs
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }} GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
+1
View File
@@ -11,5 +11,6 @@ jobs:
secrets: secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
with: with:
dir: apps/web
dependencies: | dependencies: |
matrix-js-sdk matrix-js-sdk
+1
View File
@@ -29,6 +29,7 @@ jobs:
gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }} gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }}
asset-path: dist/*.tar.gz asset-path: dist/*.tar.gz
expected-asset-count: 3 expected-asset-count: 3
dir: apps/web
notify-downstream: notify-downstream:
name: Trigger release drafter downstream name: Trigger release drafter downstream
+5 -1
View File
@@ -27,6 +27,9 @@ jobs:
- name: Typescript Syntax Check - name: Typescript Syntax Check
install: layered install: layered
command: "lint:types" command: "lint:types"
- name: Prettier
install: normal
command: "lint:prettier"
- name: ESLint - name: ESLint
install: normal install: normal
command: "lint:js" command: "lint:js"
@@ -62,7 +65,7 @@ jobs:
run: "pnpm install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Run ${{ matrix.command }} - name: Run ${{ matrix.command }}
run: pnpm run "$CMD" && pnpm -r --if-present run "$CMD" run: pnpm --if-present run "$CMD" && pnpm -r --if-present run "$CMD"
env: env:
CMD: ${{ matrix.command }} CMD: ${{ matrix.command }}
@@ -76,6 +79,7 @@ jobs:
matrix: matrix:
include: include:
- name: Element Web - name: Element Web
path: "apps/web"
allowed-hardcoded-keys: | allowed-hardcoded-keys: |
console_dev_note console_dev_note
labs|element_call_video_rooms labs|element_call_video_rooms
+4 -2
View File
@@ -67,6 +67,7 @@ jobs:
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2 uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2
- name: Run tests - name: Run tests
working-directory: apps/web
run: | run: |
pnpm test \ pnpm test \
--coverage=${{ env.ENABLE_COVERAGE }} \ --coverage=${{ env.ENABLE_COVERAGE }} \
@@ -82,6 +83,7 @@ jobs:
- name: Move coverage files into place - name: Move coverage files into place
if: env.ENABLE_COVERAGE == 'true' if: env.ENABLE_COVERAGE == 'true'
working-directory: apps/web
run: mv coverage/lcov.info coverage/${{ steps.setupNode.outputs.node-version }}-${{ matrix.runner }}.lcov.info run: mv coverage/lcov.info coverage/${{ steps.setupNode.outputs.node-version }}-${{ matrix.runner }}.lcov.info
- name: Upload Artifact - name: Upload Artifact
@@ -90,8 +92,8 @@ jobs:
with: with:
name: coverage-${{ matrix.runner }} name: coverage-${{ matrix.runner }}
path: | path: |
coverage apps/web/coverage
!coverage/lcov-report !apps/web/coverage/lcov-report
complete: complete:
name: jest-tests name: jest-tests
+1
View File
@@ -21,6 +21,7 @@ jobs:
run: "pnpm install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Fetch Jitsi - name: Fetch Jitsi
working-directory: apps/web
run: "pnpm vendor:jitsi" run: "pnpm vendor:jitsi"
- name: Create Pull Request - name: Create Pull Request
+4 -4
View File
@@ -17,7 +17,7 @@ RUN pnpm install
RUN /src/scripts/docker-package.sh RUN /src/scripts/docker-package.sh
# Copy the config now so that we don't create another layer in the app image # Copy the config now so that we don't create another layer in the app image
RUN cp /src/config.sample.json /src/webapp/config.json RUN cp /src/apps/web/config.sample.json /src/apps/web/webapp/config.json
# App # App
FROM nginxinc/nginx-unprivileged:alpine-slim@sha256:c9448f9aaf2dee3dccfe0d2e51d6927cc9fbfdbcada66b0b01c0759816d86a5b FROM nginxinc/nginx-unprivileged:alpine-slim@sha256:c9448f9aaf2dee3dccfe0d2e51d6927cc9fbfdbcada66b0b01c0759816d86a5b
@@ -28,12 +28,12 @@ USER root
# Install jq and moreutils for sponge, both used by our entrypoints # Install jq and moreutils for sponge, both used by our entrypoints
RUN apk add jq moreutils RUN apk add jq moreutils
COPY --from=builder /src/webapp /app COPY --from=builder /src/apps/web/webapp /app
# Override default nginx config. Templates in `/etc/nginx/templates` are passed # Override default nginx config. Templates in `/etc/nginx/templates` are passed
# through `envsubst` by the nginx docker image entry point. # through `envsubst` by the nginx docker image entry point.
COPY /docker/nginx-templates/* /etc/nginx/templates/ COPY /apps/web/docker/nginx-templates/* /etc/nginx/templates/
COPY /docker/docker-entrypoint.d/* /docker-entrypoint.d/ COPY /apps/web/docker/docker-entrypoint.d/* /docker-entrypoint.d/
RUN rm -rf /usr/share/nginx/html \ RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html && ln -s /app /usr/share/nginx/html