Skip to content

Commit

Permalink
Merge branch 'develop' into features/superhero-branding
Browse files Browse the repository at this point in the history
  • Loading branch information
venimus committed Nov 1, 2023
2 parents 9e7abb5 + 2d62f53 commit adba5bc
Show file tree
Hide file tree
Showing 53 changed files with 4,837 additions and 2,159 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,43 @@ name: Build
on:
pull_request: {}
push:
branches: [master]
branches: [develop, master]
# develop pushes and repository_dispatch handled in build_develop.yaml
env:
# These must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
name: "Build on ${{ matrix.image }}"
# We build on all 3 platforms to ensure we don't have any OS-specific build incompatibilities
strategy:
fail-fast: false
matrix:
image:
- ubuntu-latest
- windows-latest
- macos-latest
isDevelop:
- ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
# Skip the ubuntu-latest build for the develop branch as the dedicated CD build_develop workflow handles that
exclude:
- isDevelop: true
image: ubuntu-latest
runs-on: ${{ matrix.image }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: "yarn"

# Workaround for yarn install timeouts, especially on Windows
- run: yarn config set network-timeout 300000

- name: Install Dependencies
run: "./scripts/layered.sh"

Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/build_debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,32 @@ jobs:
env:
R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }}
R2_URL: ${{ vars.CF_R2_S3_API }}
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4

- name: Download package
run: |
wget "https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz"
wget "https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz.asc"
- name: Check GPG signature
run: |
wget "https://packages.element.io/element-release-key.gpg"
gpg --import element-release-key.gpg
gpg --fingerprint "$FINGERPRINT"
gpg --verify "element-$VERSION.tar.gz.asc" "element-$VERSION.tar.gz"
env:
FINGERPRINT: ${{ vars.GPG_FINGERPRINT }}

- name: Prepare
run: |
mkdir -p /tmp/element-web-debian/DEBIAN
cp -R debian/ /tmp/element-web-debian/DEBIAN/
mkdir -p /tmp/element-web-debian/usr/share/element-web/
wget https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz
mv element-* /tmp/element-web-debian/usr/share/element-web
mv debian/usr/share/element-web/config.sample.json /tmp/element-web-debian/usr/share/element-web/config.json
env:
VERSION: ${{ github.ref_name }}
tar -xf "element-$VERSION.tar.gz" -C /tmp/element-web/debian/usr/share/element-web --strip-components=1
cp config.sample.json /tmp/element-web-debian/usr/share/element-web/config.json
- name: Build deb package
run: |
Expand All @@ -41,15 +53,16 @@ jobs:
retention-days: 14

#- name: Upload incoming deb
# run: aws s3 cp element-io-archive-keyring.deb "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
# if: github.event.release.prerelease == false
# run: aws s3 cp element-web.deb "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}

#reprepro:
# needs: build
# name: Run reprepro
# if: inputs.deploy && github.event.release.prerelease == false
# if: github.event.release.prerelease == false
# uses: ./.github/workflows/reprepro.yaml
# secrets: inherit
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: "yarn"

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
workflow_dispatch: {}
push:
tags: [v*]
#schedule:
# schedule:
# This job can take a while, and we have usage limits, so just publish develop only twice a day
#- cron: "0 7/12 * * *"
# - cron: "0 7/12 * * *"
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
jobs:
buildx:
Expand All @@ -18,22 +18,22 @@ jobs:
fetch-depth: 0 # needed for docker-package to be able to calculate the version

- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
with:
install: true

- name: Login to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5
with:
images: |
superherodotcom/element-web
Expand All @@ -44,7 +44,7 @@ jobs:
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }}
- name: Build and push
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
with:
context: .
push: true
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Deploy documentation

on:
push:
branches: [develop]
workflow_dispatch: {}

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Fetch element-desktop
uses: actions/checkout@v4
with:
repository: vector-im/element-desktop
path: element-desktop

- name: Fetch element-web
uses: actions/checkout@v4
with:
path: element-web

- name: Fetch matrix-react-sdk
uses: actions/checkout@v4
with:
repository: matrix-org/matrix-react-sdk
path: matrix-react-sdk

- name: Fetch matrix-js-sdk
uses: actions/checkout@v4
with:
repository: matrix-org/matrix-js-sdk
path: matrix-js-sdk

- uses: actions/setup-node@v4
with:
cache: "yarn"
cache-dependency-path: element-web/yarn.lock

- name: Generate automations docs
working-directory: element-web
run: |
yarn install --frozen-lockfile
yarn ts-node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-react-sdk ../matrix-js-sdk > docs/automations.md
echo "- [Automations](automations.md)" >> docs/SUMMARY.md
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "0.4.10"

- name: Install mdbook extensions
run: cargo install mdbook-combiner mdbook-mermaid

- name: Prepare docs
run: |
mkdir docs
mv element-desktop/README.md element-desktop/docs/
mv element-desktop/docs "docs/Element Desktop"
mv element-web/README.md element-web/docs/
mv element-web/docs/lib docs/
mv element-web/docs "docs/Element Web"
mv matrix-react-sdk/README.md matrix-react-sdk/docs/
mv matrix-react-sdk/docs "docs/Matrix React SDK"
mv matrix-js-sdk/README.md matrix-js-sdk/docs/
mv matrix-js-sdk/docs "docs/Matrix JS SDK"
sed -i -e 's/\.\.\/README.md/README.md/' docs/**/SUMMARY.md
mdbook-combiner -m docs
sed -i -E 's/^\t# (.+)$/- [\1]()/gm;t' SUMMARY.md
sed -i -E 's/^- \[(.+)]\(<>\)$/---\n# \1/gm;t' SUMMARY.md
sed -i -E 's/\t- \[Introduction]/- [Introduction]/gm;t' SUMMARY.md
cat <<EOF > docs/SUMMARY.md
# Summary
- [Introduction](<Element Web/README.md>)
EOF
cat SUMMARY.md >> docs/SUMMARY.md
mv element-web/book.toml .
- name: Build docs
run: mdbook build

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./book

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .github/workflows/localazy_upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [develop]
paths:
- "src/strings/i18n/en_EN.json"
- "src/i18n/strings/en_EN.json"
jobs:
upload:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_upload.yaml@main
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/release_prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Cut branches
on:
workflow_dispatch:
inputs:
element-desktop:
description: Prepare element-desktop
required: true
type: boolean
default: true
element-web:
description: Prepare element-web
required: true
type: boolean
default: true
matrix-react-sdk:
description: Prepare matrix-react-sdk
required: true
type: boolean
default: true
matrix-js-sdk:
description: Prepare matrix-js-sdk
required: true
type: boolean
default: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout Element Desktop
uses: actions/checkout@v4
if: inputs.element-desktop
with:
repository: vector-im/element-desktop
path: element-desktop
ref: staging
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- name: Checkout Element Web
uses: actions/checkout@v4
if: inputs.element-web
with:
repository: vector-im/element-web
path: element-web
ref: staging
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- name: Checkout Matrix React SDK
uses: actions/checkout@v4
if: inputs.matrix-react-sdk
with:
repository: matrix-org/matrix-react-sdk
path: matrix-react-sdk
ref: staging
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- name: Checkout Matrix JS SDK
uses: actions/checkout@v4
if: inputs.matrix-js-sdk
with:
repository: matrix-org/matrix-js-sdk
path: matrix-js-sdk
ref: staging
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.ELEMENT_BOT_TOKEN }}

- name: Resolve repos
run: |
echo "REPOS=$(ls . | tr '\n' ' ')" >> $GITHUB_ENV
- name: Merge develop
run: |
git config --global user.email "releases@riot.im"
git config --global user.name "RiotRobot"
for REPO in $REPOS; do git -C "$REPO" merge origin/develop; done
- name: Push staging
run: for REPO in $REPOS; do git -C "$REPO" push origin staging; done
Loading

0 comments on commit adba5bc

Please sign in to comment.