to-release: released packages. #8020
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'packages/**' | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - 'packages/**' | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| - converted_to_draft | |
| env: | |
| HEAD_REF: ${{ github.event.pull_request.head.ref }} # <branch> (e.g., patch-1) | |
| HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} # <user>/blackarch | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| jobs: | |
| pkgcheck: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: blackarchlinux/blackarch:latest | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| pacman -Syu --noconfirm --needed git pkgcheck-arch nodejs # 'node' needed to test workflow locally by act | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ env.HEAD_REF }} | |
| repository: ${{ env.HEAD_REPO }} | |
| fetch-depth: 0 | |
| - name: Set up remotes and tags | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git remote add upstream "https://github.com/BlackArch/blackarch.git" | |
| git fetch --tags origin | |
| git fetch upstream master | |
| - name: Check Styling | |
| run: | | |
| CHANGED_FILES=($(git diff --name-only --diff-filter=ACMRT upstream/master...${{ env.HEAD_SHA }} | tr '\n' ' ')) | |
| for FILE in "${CHANGED_FILES[@]}"; do | |
| if [[ $(basename $FILE) == "PKGBUILD" ]]; then | |
| echo "Validating $FILE..." | |
| pkgcheck $FILE | |
| fi | |
| done | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ env.HEAD_REF }} | |
| repository: ${{ env.HEAD_REPO }} | |
| fetch-depth: 0 | |
| - name: Set up remotes and tags | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git remote add upstream "https://github.com/BlackArch/blackarch.git" | |
| git fetch --tags origin | |
| git fetch upstream master | |
| - name: Build Package | |
| run: | | |
| CHANGED_FILES=($(git diff --name-only --diff-filter=ACMRT upstream/master...${{ env.HEAD_SHA }} | tr '\n' ' ')) | |
| for FILE in "${CHANGED_FILES[@]}"; do | |
| if [[ $(basename $FILE) == "PKGBUILD" ]]; then | |
| echo "Building $FILE..." | |
| docker build --load -t builder -f travis/Dockerfile $(dirname $FILE) | |
| docker run --rm builder | |
| fi | |
| done |