Pinned libolm to a specific version #156
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
env: | |
FLUTTER_VERSION: 3.10.6 | |
LIBOLM_VERSION: 3.2.9 | |
name: Deploying on GitHub Pages | |
jobs: | |
deploy_preview: | |
name: Deploy preview versions on pull requests | |
runs-on: ubuntu-latest | |
permissions: | |
deployments: write | |
pull-requests: write | |
contents: write | |
environment: | |
name: PR-${{ github.event.pull_request.number }} | |
url: ${{ steps.configure.outputs.URL }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}" | |
- uses: webfactory/ssh-agent@v0.8.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
# - name: Setup Nix (to build libolm) | |
# uses: cachix/install-nix-action@v19 | |
- name: Build libolm | |
run: | | |
rm -rf assets/js | |
mkdir -p assets/js/package | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
# Download and install the latest SDK tools. | |
./emsdk install latest | |
# Make the "latest" SDK "active" for the current user. (writes .emscripten file) | |
./emsdk activate latest | |
# Activate PATH and other environment variables in the current terminal | |
source ./emsdk_env.sh | |
git clone -b "$LIBOLM_VERSION" https://gitlab.matrix.org/matrix-org/olm.git | |
cd olm | |
LEGACY_RUNTIME=true make js | |
cp javascript/{olm.js,olm_legacy.js,olm.wasm} ../../assets/js/package | |
- name: Build Web version | |
env: | |
FOLDER: ${{ github.event.pull_request.number }} | |
run: | | |
flutter config --enable-web | |
flutter clean | |
flutter pub get | |
flutter pub run build_runner build --delete-conflicting-outputs | |
flutter build web --release --verbose --source-maps --base-href="/${GITHUB_REPOSITORY##*/}/$FOLDER/" | |
yq '.issue_id = strenv(FOLDER)' config.sample.json > ./build/web/config.json | |
- name: Configure environments | |
id: configure | |
env: | |
FOLDER: ${{ github.event.pull_request.number }} | |
run: | | |
echo "URL=https://$GITHUB_REPOSITORY_OWNER.github.io/${GITHUB_REPOSITORY##*/}/$FOLDER" >> $GITHUB_OUTPUT | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/web | |
keep_files: true | |
destination_dir: "${{ github.event.pull_request.number }}" | |
- name: Find deployment comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
comment-author: "github-actions[bot]" | |
issue-number: ${{ github.event.pull_request.number }} | |
body-includes: "This PR has been deployed to" | |
- name: Create or update deployment comment | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
This PR has been deployed to ${{ steps.configure.outputs.URL }} | |
edit-mode: replace |