Files
MINGW-packages/.github/workflows/generate-srcinfo.yml
2021-12-10 13:47:52 +01:00

68 lines
2.0 KiB
YAML

name: generate-srcinfo
concurrency: ci-${{ github.ref }}
on:
push:
branches:
- master
workflow_dispatch:
jobs:
update-srcinfo:
runs-on: windows-2022
if: ${{ github.repository == 'msys2/MINGW-packages' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: msys2/setup-msys2@v2
with:
msystem: MSYS
install: binutils
update: true
- name: Download srcinfo.json and set up the environment
shell: msys2 {0}
run: |
# XXX: linting PKGBUILDs takes a loooong time, this skips it
sed -i s/^lint_pkgbuild/#lint_pkgbuild/g /usr/bin/makepkg
# XXX: we don't need the toolchains for --printsrcinfo, but makepkg-mingw complains if gcc doesn't exist
touch /mingw64/bin/gcc.exe /mingw32/bin/gcc.exe /ucrt64/bin/gcc.exe /clang64/bin/clang.exe /clang32/bin/clang.exe /clangarm64/bin/clang.exe
curl --fail -L --retry 5 -o srcinfo.json "https://github.com/$GITHUB_REPOSITORY/releases/download/srcinfo-cache/srcinfo.json"
- name: Parse PKGBUILDs and update srcinfo.json
run: |
$MSYS2_ROOT=(msys2 -c 'cygpath -w /')
python -u .ci/ci-generate-srcinfo.py --time-limit 19800 mingw "$MSYS2_ROOT" . srcinfo.json
- uses: actions/upload-artifact@v2
with:
name: result
path: srcinfo.json
upload-srcinfo:
needs: update-srcinfo
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v2
with:
name: result
- name: Upload srcinfo.json
run: |
gh release upload srcinfo-cache srcinfo.json --clobber --repo "$GITHUB_REPOSITORY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
curl -X POST 'https://packages.msys2.org/api/trigger_update'