Skip to content

Run

Run #398

Workflow file for this run

name: Run
on:
workflow_dispatch:
inputs:
target:
description: "Target to build"
required: true
type: string
default: "deploy"
pull_request:
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: fcitx5-android
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
# Deploy needs IPv6 support
- name: Set up WARP
if: ${{ inputs.target == 'deploy' }}
uses: fscarmen/warp-on-actions@v1.3
with:
stack: ipv6
mode: client
- name: Run fdroid-build
env:
SIGN_KEY_BASE64: ${{ secrets.SIGN_KEY_BASE64 }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PWD: ${{ secrets.SIGN_KEY_PWD }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USER: ${{ vars.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
nix develop .#ci --command cabal update
nix develop .#ci --command cabal run fdroid-build -- ${{ inputs.target || 'build' }} ${{ github.event_name == 'pull_request' && '--skip-fdroid' || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugins
path: _build/signed/*.apk
- name: Read changelog
id: changelog
if: ${{ inputs.target == 'deploy' && hashFiles('_build/changelog.txt') != ''}}
run: |
echo 'changelog<<EOF' >> $GITHUB_OUTPUT
cat _build/changelog.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo "### Changelog :rocket:" >> $GITHUB_STEP_SUMMARY
cat _build/changelog.txt >> $GITHUB_STEP_SUMMARY
- name: Send Telegram message
if: ${{ inputs.target == 'deploy' && hashFiles('_build/deployed') != ''}}
run: |
curl -X POST https://api.telegram.org/bot${{secrets.TELEGRAM_TOKEN}}/sendMessage \
-H "content-type: application/json" \
-d @- << EOF
{
"chat_id": "${{ secrets.TELEGRAM_TO }}",
"text": "F-Droid repo updated:\n${{ steps.changelog.outputs.changelog }}"
}
EOF