chore: Add MJML example #72
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 Globe Runtime Shared Library | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| pull_request: | |
| jobs: | |
| Build: | |
| name: Build - ${{ matrix.platform.os-name }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - os-name: MacOS-x86_64 | |
| runs-on: macos-15-intel | |
| target: x86_64-apple-darwin | |
| - os-name: MacOS-aarch64 | |
| runs-on: macos-15 | |
| target: aarch64-apple-darwin | |
| - os-name: Linux-x86_64 | |
| runs-on: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| - os-name: Linux-aarch64 | |
| runs-on: ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| - os-name: Windows-x86_64 | |
| runs-on: windows-2025 | |
| target: x86_64-pc-windows-msvc | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Build Shared Library | |
| uses: houseabsolute/actions-rust-cross@v1 | |
| with: | |
| command: build | |
| target: ${{ matrix.platform.target }} | |
| args: "--locked --release" | |
| strip: true | |
| - name: Find built shared library | |
| id: find_artifact | |
| shell: bash | |
| run: | | |
| echo "Locating build artifact..." | |
| if [[ "${{ matrix.platform.target }}" == *"windows"* ]]; then | |
| EXT="dll" | |
| elif [[ "${{ matrix.platform.target }}" == *"apple"* ]]; then | |
| EXT="dylib" | |
| else | |
| EXT="so" | |
| fi | |
| ARTIFACT_GLOB="target/${{ matrix.platform.target }}/release/*.${EXT}" | |
| ARTIFACT_FILE=$(ls $ARTIFACT_GLOB 2>/dev/null || true) | |
| if [[ -z "$ARTIFACT_FILE" ]]; then | |
| echo "Error: No built library found at $ARTIFACT_GLOB" | |
| exit 1 | |
| fi | |
| echo "artifact_path=$ARTIFACT_FILE" >> $GITHUB_OUTPUT | |
| echo "Found artifact: $ARTIFACT_FILE" | |
| # Prepare new filename | |
| BASENAME=$(basename "$ARTIFACT_FILE") | |
| NEW_NAME="${BASENAME%.*}-${{ matrix.platform.target }}.${EXT}" | |
| mv "$ARTIFACT_FILE" "$NEW_NAME" | |
| echo "artifact_path=$NEW_NAME" >> $GITHUB_ENV | |
| - name: Upload built library as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.artifact_path }} | |
| path: ${{ env.artifact_path }} | |
| Test: | |
| needs: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download Linux x86_64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libglobe_runtime-x86_64-unknown-linux-gnu.so | |
| path: ./artifacts | |
| - name: Add library path to environment | |
| run: | | |
| LIB_PATH="${GITHUB_WORKSPACE}/artifacts/libglobe_runtime-x86_64-unknown-linux-gnu.so" | |
| echo "GLOBE_RUNTIME_LIB_PATH=${LIB_PATH}" >> $GITHUB_ENV | |
| echo "Library path set to: ${LIB_PATH}" | |
| ls -la "${LIB_PATH}" | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Run Dart Tests | |
| working-directory: packages/globe_runtime | |
| run: dart test --reporter expanded --concurrency=1 | |
| Release: | |
| name: Publish Release | |
| if: github.ref_type == 'tag' | |
| needs: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist/ | |
| - name: List downloaded artifacts | |
| run: ls -R dist/ | |
| - name: Publish all artifacts to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/**/* |