|
| 1 | +name: Build MathJax Project with Atlassian SDK |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + # Checkout repository |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v3 |
| 19 | + |
| 20 | + # Set up Java 17 |
| 21 | + - name: Set up Java 17 |
| 22 | + uses: actions/setup-java@v3 |
| 23 | + with: |
| 24 | + java-version: '17' |
| 25 | + distribution: 'temurin' |
| 26 | + |
| 27 | + # Install required system dependencies |
| 28 | + - name: Install required packages |
| 29 | + run: sudo apt-get update && sudo apt-get install -y curl tar |
| 30 | + |
| 31 | + # Download and install Atlassian SDK |
| 32 | + - name: Install Atlassian SDK |
| 33 | + run: | |
| 34 | + curl -L https://packages.atlassian.com/maven/org/atlassian/amps/atlassian-plugin-sdk/9.0.2/atlassian-plugin-sdk-9.0.2.tar.gz -o atlassian-plugin-sdk.tar.gz |
| 35 | + sudo tar -xvzf atlassian-plugin-sdk.tar.gz -C /opt |
| 36 | + sudo mv /opt/atlassian-plugin-sdk-9.0.2 /opt/atlassian-plugin-sdk |
| 37 | + echo 'export PATH=$PATH:/opt/atlassian-plugin-sdk/bin' >> $GITHUB_ENV |
| 38 | +
|
| 39 | + # Verify SDK installation |
| 40 | + - name: Verify Atlassian SDK installation |
| 41 | + run: atlas-version |
| 42 | + |
| 43 | + # Build MathJax Plugin |
| 44 | + - name: Build MathJax Plugin |
| 45 | + working-directory: ./mathjax |
| 46 | + run: | |
| 47 | + atlas-package |
| 48 | +
|
| 49 | + # Install Rust |
| 50 | + - name: Set up Rust |
| 51 | + uses: actions-rs/toolchain@v1 |
| 52 | + with: |
| 53 | + profile: minimal |
| 54 | + toolchain: stable |
| 55 | + override: true |
| 56 | + |
| 57 | + # Add Rust target |
| 58 | + - name: Add Rust target |
| 59 | + run: rustup target add x86_64-unknown-linux-gnu |
| 60 | + |
| 61 | + # Build MathJax Server |
| 62 | + - name: Build MathJax Server |
| 63 | + working-directory: ./mathjax-server |
| 64 | + run: | |
| 65 | + cargo build --release --target x86_64-unknown-linux-gnu |
| 66 | +
|
| 67 | + # Upload artifacts |
| 68 | + - name: Upload build artifacts |
| 69 | + uses: actions/upload-artifact@v3 |
| 70 | + with: |
| 71 | + name: build-artifacts |
| 72 | + path: | |
| 73 | + mathjax/target |
| 74 | + mathjax-server/target/x86_64-unknown-linux-gnu/release/ |
0 commit comments