|
| 1 | +name: Build MSYS2 package |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + package_name: |
| 7 | + description: "Package name to build" |
| 8 | + type: string |
| 9 | + needs: |
| 10 | + description: "Parent workflow job dependencies" |
| 11 | + type: string |
| 12 | + dependencies: |
| 13 | + description: "Install additional dependencies" |
| 14 | + type: string |
| 15 | + default: "" |
| 16 | + packages_repository: |
| 17 | + description: "MSYS2 packages repository to build from" |
| 18 | + type: string |
| 19 | + default: "Windows-on-ARM-Experiments/MSYS2-packages" |
| 20 | + packages_branch: |
| 21 | + description: "MSYS2 packages branch to build from" |
| 22 | + type: string |
| 23 | + default: "woarm64" |
| 24 | + |
| 25 | +defaults: |
| 26 | + run: |
| 27 | + shell: msys2 {0} |
| 28 | + |
| 29 | +env: |
| 30 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + |
| 32 | +jobs: |
| 33 | + build: |
| 34 | + runs-on: windows-latest |
| 35 | + |
| 36 | + steps: |
| 37 | + - uses: msys2/setup-msys2@v2 |
| 38 | + with: |
| 39 | + msystem: MSYS |
| 40 | + update: true |
| 41 | + |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Setup packages repository |
| 46 | + run: | |
| 47 | + `cygpath "${{ github.workspace }}"`/.github/scripts/setup-repository.sh |
| 48 | +
|
| 49 | + - name: Install dependencies |
| 50 | + run: | |
| 51 | + pacman -S --noconfirm \ |
| 52 | + base-devel \ |
| 53 | + git \ |
| 54 | + mingw-w64-x86_64-github-cli \ |
| 55 | + mingw-w64-x86_64-jq \ |
| 56 | + ${{ inputs.dependencies }} |
| 57 | +
|
| 58 | + - name: Checkout repository |
| 59 | + uses: actions/checkout@v4 |
| 60 | + |
| 61 | + - name: Checkout ${{ inputs.packages_repository }} repository |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + repository: ${{ inputs.packages_repository }} |
| 65 | + ref: ${{ inputs.packages_branch }} |
| 66 | + path: ${{ github.workspace }}/packages |
| 67 | + |
| 68 | + - name: Download artifacts |
| 69 | + if: ${{ inputs.needs }} |
| 70 | + run: | |
| 71 | + `cygpath "${{ github.workspace }}"`/.github/scripts/download-artifacts.sh ${{ github.run_id }} '${{ inputs.needs }}' |
| 72 | +
|
| 73 | + - name: Install artifacts |
| 74 | + if: ${{ inputs.needs }} |
| 75 | + run: | |
| 76 | + `cygpath "${{ github.workspace }}"`/.github/scripts/install-artifacts.sh |
| 77 | +
|
| 78 | + - name: Copy missing headers for mingw-w64-cross-crt |
| 79 | + if: ${{ inputs.package_name == 'mingw-w64-cross-crt' }} |
| 80 | + run: | |
| 81 | + `cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack.sh |
| 82 | +
|
| 83 | + - name: Build ${{ inputs.package_name }} |
| 84 | + working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }} |
| 85 | + run: | |
| 86 | + `cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }} |
| 87 | +
|
| 88 | + - name: Upload ${{ inputs.package_name }} |
| 89 | + uses: actions/upload-artifact@v4 |
| 90 | + with: |
| 91 | + name: ${{ inputs.package_name }} |
| 92 | + retention-days: 1 |
| 93 | + path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst |
0 commit comments