Added wasm workflow to CI #10
Workflow file for this run
This file contains hidden or 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
name: 'Build: Wasm' | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
build_mode: | |
description: 'Build mode: devel, nightly, testing, stable' | |
default: 'devel' | |
required: true | |
workflow_call: | |
inputs: | |
build_mode: | |
description: 'Build mode: devel, nightly, testing, stable' | |
default: 'devel' | |
type: string | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Configure workflow | |
env: | |
pull_request_title: ${{ github.event.pull_request.title }} | |
run: | | |
bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }} | |
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env) | |
bash ./buildscripts/ci/tools/make_build_number.sh | |
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env) | |
DO_UPDATE_TS='false' | |
if [[ "$BUILD_MODE" == "testing" || "$BUILD_MODE" == "stable" ]]; then | |
DO_UPDATE_TS='true' | |
if [ -z "${{ secrets.TRANSIFEX_API_TOKEN }}" ]; then | |
echo "::warning::TRANSIFEX_API_TOKEN is empty; updating .ts files disabled" | |
DO_UPDATE_TS='false' | |
fi | |
fi | |
DO_PLACEHOLDER_TRANSLATIONS='false' | |
if [[ "$BUILD_MODE" == "nightly" || "$BUILD_MODE" == "devel" ]]; then | |
DO_PLACEHOLDER_TRANSLATIONS='true' | |
fi | |
ADD_INFO="_${GITHUB_REF#refs/heads/}" | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}" | |
fi | |
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Wasm${ADD_INFO}")" | |
echo "github.repository: ${{ github.repository }}" | |
echo "BUILD_MODE=$BUILD_MODE" | tee -a $GITHUB_ENV | |
echo "BUILD_NUMBER=$BUILD_NUMBER" | tee -a $GITHUB_ENV | |
echo "DO_UPDATE_TS=$DO_UPDATE_TS" | tee -a $GITHUB_ENV | |
echo "DO_PLACEHOLDER_TRANSLATIONS=$DO_PLACEHOLDER_TRANSLATIONS" | tee -a $GITHUB_ENV | |
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV | |
echo "CCACHE_TIMESTAMP=$(date -u +"%F-%T")" | tee -a $GITHUB_ENV | |
- name: Restore ccache files | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.ccache | |
key: wasm-ccache-${{ env.CCACHE_TIMESTAMP }} | |
restore-keys: wasm-ccache- | |
- name: Setup ccache | |
run: | | |
sudo apt-get update && sudo apt-get install -y ccache | |
bash ./buildscripts/ci/tools/setup_ccache_config.sh | |
- name: Register gcc problem matcher | |
run: echo "::add-matcher::.github/problem_matchers/gcc.json" | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '6.9.1' | |
host: all_os | |
target: 'wasm' | |
arch: wasm_singlethread | |
modules: 'qt5compat' | |
- name: Setup environment | |
run: | | |
bash ./buildscripts/ci/linux/setup.sh --arch wasm | |
- name: Generate _en.ts files | |
env: | |
LUPDATE_ARGS: "" | |
POSTPROCESS_ARGS: ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }} | |
run: | | |
bash ./tools/translations/run_lupdate.sh | |
- name: Update .ts files (tx pull) | |
if: env.DO_UPDATE_TS == 'true' | |
uses: transifex/cli-action@v2 | |
with: | |
token: ${{ secrets.TRANSIFEX_API_TOKEN }} | |
args: "pull -f" | |
- name: Build | |
run: | | |
bash ./buildscripts/ci/wasm/build.sh -n ${{ env.BUILD_NUMBER }} | |
echo "============== ccache ===============" | |
ccache -sv | |
- name: Package | |
run: | | |
bash ./buildscripts/ci/wasm/package.sh | |
- name: Upload artifacts on GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.UPLOAD_ARTIFACT_NAME }} | |
path: ./build.artifacts/ |