fix: remove GetTimeout from conf/updates (unsupported by reprepro) (#26) #38
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
| # Main PPA build workflow | |
| # Triggers on PPA updates to build all packages | |
| name: PPA Build (Main) | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - ".github/workflows/main.yml" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - ".github/workflows/main.yml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Detect changed submodules | |
| id: detect | |
| run: | | |
| # Get list of all submodules (as JSON array) | |
| SUBMODULES=$(git submodule status | awk '{print $2}' | grep '^src/diepxuan/' | sed 's|^src/diepxuan/||' | sed 's|/$||' | jq -R -s -c 'split("\n") | map(select(length > 0))') | |
| # For manual trigger, build all | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "packages=$SUBMODULES" >> $GITHUB_OUTPUT | |
| echo "All packages will be built (manual trigger)" | |
| exit 0 | |
| fi | |
| # Get base ref | |
| BASE_REF="${{ github.base_ref }}" | |
| if [[ -z "$BASE_REF" ]]; then | |
| BASE_REF="main" | |
| fi | |
| # Get changed files | |
| CHANGES=$(git diff --name-only origin/$BASE_REF...HEAD 2>/dev/null || git diff --name-only HEAD~1...HEAD 2>/dev/null || echo "") | |
| echo "Changes detected: $CHANGES" | |
| # Find which submodules have changes (as JSON array) | |
| CHANGED_PACKAGES="$SUBMODULES" | |
| if [[ -n "$CHANGES" ]]; then | |
| CHANGED_JSON="[]" | |
| for submodule in $(git submodule status | awk '{print $2}' | grep '^src/diepxuan/' | sed 's|^src/diepxuan/||' | sed 's|/$||'); do | |
| if echo "$CHANGES" | grep -q "^src/diepxuan/$submodule/"; then | |
| echo "Package '$submodule' has changes" | |
| CHANGED_JSON=$(echo "$CHANGED_JSON" | jq -c ". + [\"$submodule\"]") | |
| fi | |
| done | |
| CHANGED_PACKAGES="$CHANGED_JSON" | |
| fi | |
| if [[ "$CHANGED_PACKAGES" == "[]" ]]; then | |
| echo "No package changes detected" | |
| echo "packages=[]" >> $GITHUB_OUTPUT | |
| else | |
| echo "packages=$CHANGED_PACKAGES" >> $GITHUB_OUTPUT | |
| echo "Will build: $CHANGED_PACKAGES" | |
| fi | |
| package-build: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.packages != '' | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJson(needs.detect-changes.outputs.packages) }} | |
| uses: diepxuan/.github/.github/workflows/debian-package-ppa.yml@main | |
| with: | |
| module: ${{ matrix.package }} | |
| secrets: | |
| GPG_KEY: ${{ secrets.GPG_KEY }} | |
| GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
| GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
| SSH_ID_RSA: ${{ secrets.SSH_ID_RSA }} |