Update workflows

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2026-02-24 16:11:24 +00:00
parent 41d6094cc0
commit e84ae7a6d6
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
12 changed files with 43 additions and 19 deletions

View File

@ -57,9 +57,11 @@ jobs:
run: ./scripts/layered.sh
- name: Copy config
working-directory: apps/web
run: cp element.io/develop/config.json config.json
- name: Build
working-directory: apps/web
env:
CI_PACKAGE: true
run: VERSION=$(scripts/get-version-from-git.sh) pnpm build
@ -68,5 +70,5 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: webapp-${{ matrix.image }}
path: webapp
path: apps/web/webapp
retention-days: 1

View File

@ -17,11 +17,13 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download package
working-directory: apps/web
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.asc"
- name: Check GPG signature
working-directory: apps/web
run: |
wget "https://packages.element.io/element-release-key.gpg"
gpg --import element-release-key.gpg
@ -31,6 +33,7 @@ jobs:
FINGERPRINT: ${{ vars.GPG_FINGERPRINT }}
- name: Prepare
working-directory: apps/web
run: |
mkdir -p 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
- name: Write changelog
working-directory: apps/web
run: |
VERSION=$(cat package.json | jq -r .version)
TIME=$(date -d "$PUBLISHED_AT" -R)
@ -57,6 +61,7 @@ jobs:
PUBLISHED_AT: ${{ github.event.release.published_at }}
- name: Build deb package
working-directory: apps/web
run: |
VERSION=$(cat package.json | jq -r .version)
dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog
@ -65,14 +70,14 @@ jobs:
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: element-web.deb
path: element-web.deb
path: apps/web/element-web.deb
retention-days: 14
- name: Publish to packages.element.io
if: github.event.release.prerelease == false
uses: element-hq/packages.element.io@master
with:
file: element-web.deb
file: apps/web/element-web.deb
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
bucket-api: ${{ vars.CF_R2_S3_API }}
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}

View File

@ -40,6 +40,7 @@ jobs:
run: "./scripts/layered.sh"
- name: Build, Package & Upload sourcemaps
working-directory: apps/web
run: "./scripts/ci_package.sh"
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
@ -55,20 +56,22 @@ jobs:
CSP_EXTRA_SOURCE: ${{ env.R2_PUBLIC_URL }}
- run: mv dist/element-*.tar.gz dist/develop.tar.gz
working-directory: apps/web
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: webapp
path: dist/develop.tar.gz
path: apps/web/dist/develop.tar.gz
retention-days: 1
- name: Extract webapp
run: |
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
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
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/
- name: Deploy to R2
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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}

View File

@ -70,7 +70,7 @@ jobs:
run: cp -vnpr _current_version/bundles/* _deploy/bundles/
- 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
run: echo "404 Not Found" > _deploy/404.html

View File

@ -41,6 +41,7 @@ jobs:
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: apps/web/Dockerfile
load: true
- name: Test the image
@ -151,6 +152,7 @@ jobs:
if: github.event_name != 'pull_request'
with:
context: .
file: apps/web/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}

View File

@ -68,18 +68,20 @@ jobs:
run: scripts/layered.sh
- name: Copy config
working-directory: apps/web
run: cp element.io/develop/config.json config.json
- name: Build
env:
CI_PACKAGE: true
working-directory: apps/web
run: VERSION=$(scripts/get-version-from-git.sh) pnpm build
- name: Upload Artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: webapp
path: webapp
path: apps/web/webapp
retention-days: 1
- name: Calculate runner variables
@ -133,7 +135,7 @@ jobs:
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: webapp
path: webapp
path: apps/web/webapp
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- 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
- name: Run Playwright tests
working-directory: apps/web
run: |
pnpm playwright test \
--shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \
@ -178,7 +181,7 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: all-blob-reports-${{ matrix.project }}-${{ matrix.runner }}
path: blob-report
path: apps/web/blob-report
retention-days: 1
downstream-modules:
@ -225,7 +228,7 @@ jobs:
- name: Merge into HTML Report
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:
# Only pass creds to the flaky-reporter on main branch runs
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}

View File

@ -11,5 +11,6 @@ jobs:
secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
with:
dir: apps/web
dependencies: |
matrix-js-sdk

View File

@ -29,6 +29,7 @@ jobs:
gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }}
asset-path: dist/*.tar.gz
expected-asset-count: 3
dir: apps/web
notify-downstream:
name: Trigger release drafter downstream

View File

@ -27,6 +27,9 @@ jobs:
- name: Typescript Syntax Check
install: layered
command: "lint:types"
- name: Prettier
install: normal
command: "lint:prettier"
- name: ESLint
install: normal
command: "lint:js"
@ -62,7 +65,7 @@ jobs:
run: "pnpm install --frozen-lockfile"
- 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:
CMD: ${{ matrix.command }}
@ -76,6 +79,7 @@ jobs:
matrix:
include:
- name: Element Web
path: "apps/web"
allowed-hardcoded-keys: |
console_dev_note
labs|element_call_video_rooms

View File

@ -67,6 +67,7 @@ jobs:
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2
- name: Run tests
working-directory: apps/web
run: |
pnpm test \
--coverage=${{ env.ENABLE_COVERAGE }} \
@ -82,6 +83,7 @@ jobs:
- name: Move coverage files into place
if: env.ENABLE_COVERAGE == 'true'
working-directory: apps/web
run: mv coverage/lcov.info coverage/${{ steps.setupNode.outputs.node-version }}-${{ matrix.runner }}.lcov.info
- name: Upload Artifact
@ -90,8 +92,8 @@ jobs:
with:
name: coverage-${{ matrix.runner }}
path: |
coverage
!coverage/lcov-report
apps/web/coverage
!apps/web/coverage/lcov-report
complete:
name: jest-tests

View File

@ -21,6 +21,7 @@ jobs:
run: "pnpm install --frozen-lockfile"
- name: Fetch Jitsi
working-directory: apps/web
run: "pnpm vendor:jitsi"
- name: Create Pull Request

View File

@ -17,7 +17,7 @@ RUN pnpm install
RUN /src/scripts/docker-package.sh
# 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
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
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
# through `envsubst` by the nginx docker image entry point.
COPY /docker/nginx-templates/* /etc/nginx/templates/
COPY /docker/docker-entrypoint.d/* /docker-entrypoint.d/
COPY /apps/web/docker/nginx-templates/* /etc/nginx/templates/
COPY /apps/web/docker/docker-entrypoint.d/* /docker-entrypoint.d/
RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html