Build plugin artifacts #1
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 plugin artifacts | |
| # Builds every example plugin's .cgp and exposes them as downloadable | |
| # workflow artifacts. Unlike "Update libs from CodeOnTheGo", this never | |
| # commits refreshed libs, never publishes a GitHub release, and never | |
| # deploys to the website — it only produces artifacts you can download | |
| # from the run summary. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| codeonthego_ref: | |
| description: CodeOnTheGo branch or tag to build the libs against | |
| required: false | |
| default: stage | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout plugin-examples | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| cache-disabled: true | |
| add-job-summary: 'never' | |
| - name: Build libs and plugins | |
| env: | |
| CODEONTHEGO_REF: ${{ github.event.inputs.codeonthego_ref }} | |
| run: ./scripts/update-libs.sh --ref "$CODEONTHEGO_REF" | |
| - name: Stage .cgp files with website filenames | |
| run: | | |
| mkdir -p deploy-staging | |
| declare -A MAP=( | |
| ["apk-viewer"]="apk-analyzer.cgp" | |
| ["Beepy"]="beepy.cgp" | |
| ["keystore-generator"]="keystore-generator.cgp" | |
| ["markdown-preview"]="markdown-previewer.cgp" | |
| ["ndk-installer-plugin"]="ndk-installer.cgp" | |
| ["random-xkcd"]="random-xkcd.cgp" | |
| ["snippets"]="snippets.cgp" | |
| ) | |
| for module in "${!MAP[@]}"; do | |
| src=$(ls "${module}/build/plugin/"*.cgp 2>/dev/null | head -n1) | |
| if [ -z "$src" ]; then | |
| echo "ERROR: no .cgp found under ${module}/build/plugin/" | |
| exit 1 | |
| fi | |
| cp "$src" "deploy-staging/${MAP[$module]}" | |
| echo "Staged $src -> deploy-staging/${MAP[$module]}" | |
| done | |
| ls -la deploy-staging/ | |
| - name: Upload .cgp artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugins-cgp | |
| path: deploy-staging/*.cgp | |
| retention-days: 7 | |
| if-no-files-found: error |