WIP: Native MinGW toolchain #348
This file contains 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 MinGW and MSYS2 toolchains | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
msys2_packages_branch: | |
description: "MSYS2-packages branch to build" | |
type: string | |
required: false | |
default: "woarm64" | |
mingw_packages_branch: | |
description: "MINGW-packages branch to build" | |
type: string | |
required: false | |
default: "woarm64" | |
jobs: | |
mingw-cross-toolchain: | |
name: MinGW cross-compilation toolchain | |
uses: ./.github/workflows/mingw-cross-toolchain.yml | |
with: | |
msys2_packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }} | |
mingw-native-toolchain: | |
name: MinGW native toolchain | |
uses: ./.github/workflows/mingw-native-toolchain.yml | |
with: | |
mingw_packages_branch: ${{ inputs.mingw_packages_branch || 'woarm64' }} | |
repository: | |
name: Create MSYS2 repository | |
needs: [ | |
mingw-cross-toolchain, | |
mingw-native-toolchain | |
] | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: Windows-on-ARM-Experiments/setup-msys2@main | |
with: | |
msystem: MSYS | |
update: true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
pacman -S --noconfirm \ | |
git \ | |
mingw-w64-x86_64-github-cli \ | |
mingw-w64-x86_64-jq | |
- name: Download artifacts | |
run: | | |
`cygpath "${{ github.workspace }}"`/.github/scripts/download-artifacts.sh \ | |
${{ github.run_id }} \ | |
'${{ needs.mingw-cross-toolchain.outputs.artifacts }}' \ | |
'${{ needs.mingw-native-toolchain.outputs.artifacts }}' | |
- name: Create MSYS2 packages repository | |
run: | | |
`cygpath "${{ github.workspace }}"`/.github/scripts/create-repository.sh | |
- name: Create index.html | |
run: | | |
echo "<!DOCTYPE html><head></head><body></body>" > repository/index.html | |
- name: Upload woarm64-msys2-repository | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: woarm64-msys2-repository | |
retention-days: 7 | |
path: repository | |
deploy: | |
#if: github.ref == 'refs/heads/main' | |
name: Deploy MSYS2 repository | |
needs: repository | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
defaults: | |
run: | |
shell: bash {0} | |
steps: | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v4 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: woarm64-msys2-repository | |
check: | |
name: Check MSYS2 repository | |
needs: deploy | |
uses: ./.github/workflows/check-repository.yml |