Skip to content

Workflow file for this run

name: Build and Release MathJax Project with Atlassian SDK
on:
push:
tags:
- 'v*' # Trigger only on tags starting with 'v'
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout code
uses: actions/checkout@v3
# Set up Java 17
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# Install required system dependencies
- name: Install required packages
run: sudo apt-get update && sudo apt-get install -y curl tar
# Download and install Atlassian SDK
- name: Install Atlassian SDK
run: |
curl -L https://marketplace.atlassian.com/download/plugins/atlassian-plugin-sdk-tgz -o atlassian-plugin-sdk.tar.gz
sudo tar -xvzf atlassian-plugin-sdk.tar.gz -C /opt
sdk_dir=$(find /opt -maxdepth 1 -type d -name "atlassian-plugin-sdk-*")
sudo mv "$sdk_dir" /opt/atlassian-plugin-sdk
sudo chmod -R +x /opt/atlassian-plugin-sdk/bin
sudo chmod -R +x /opt/atlassian-plugin-sdk/apache-maven-*/bin
echo "/opt/atlassian-plugin-sdk/bin" >> $GITHUB_PATH
echo "/opt/atlassian-plugin-sdk/apache-maven-*/bin" >> $GITHUB_PATH
# Verify SDK installation
- name: Verify Atlassian SDK installation
run: atlas-version
# Build MathJax Plugin
- name: Build MathJax Plugin
working-directory: ./mathjax
run: atlas-package
# Install Rust
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# Add Rust target
- name: Add Rust target
run: rustup target add x86_64-unknown-linux-gnu
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: |
mathjax-server
# Build MathJax Server
- name: Build MathJax Server
working-directory: ./mathjax-server
run: cargo build --release --target x86_64-unknown-linux-gnu
# Package artifacts
- name: Package artifacts
run: |
mkdir -p release
cp mathjax/target/*.jar release/
cp mathjax-server/target/x86_64-unknown-linux-gnu/release/mathjax-server release/
zip -j "release/confluence-mathjax-plugin-${{ github.ref_name }}.zip" release/*
# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: conf-mathjax-plugin.zip
path: release/confluence-mathjax-plugin-*.zip
# Create GitHub Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release/confluence-mathjax-plugin-*.zip
name: Confluence MathJax Plugin ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
prerelease: false