build32 #1067
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: build32 | |
on: | |
workflow_dispatch: | |
inputs: | |
packages: | |
description: 'Packages to build (space-delimited)' | |
required: true | |
repository: | |
description: 'Repository to check out' | |
required: true | |
default: msys2/MSYS2-packages | |
ref: | |
description: 'Ref of repository to check out' | |
required: true | |
default: master | |
install_extras: | |
description: 'Extra packages to install' | |
dont_upload: | |
description: 'Don''t upload artifacts to release' | |
type: boolean | |
required: false | |
release_name: | |
description: 'Release/tag to upload to' | |
required: true | |
default: repo | |
repo_db_name: | |
description: 'Name of the pacman database' | |
required: true | |
default: build32 | |
env: | |
PACMAN_REPOSITORY_NAME: ${{ github.event.inputs.repo_db_name }} | |
DEPLOY_PROVIDER: tip | |
PACMAN_REPOSITORY_URL: https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.release_name }} | |
MSYS: nonativeinnerlinks | |
jobs: | |
build32: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.inputs.repository }} | |
ref: ${{ github.event.inputs.ref }} | |
path: r | |
- id: msys2 | |
uses: jeremyd2019/setup-msys2@v2_32 | |
with: | |
msystem: MSYS | |
install: git base-devel msys2-devel pactoys-git | |
update: true | |
bitness: 32 | |
- name: Add build32 repo | |
if: ${{ github.event.inputs.release_name != 'repo' || github.event.inputs.repo_db_name != 'build32' }} | |
continue-on-error: true | |
run: | | |
grep -qF "[build32]" /etc/pacman.conf || sed -i "/\[msys\]/i [build32]\nServer = https://github.com/${{ github.repository }}/releases/download/repo\nSigLevel = Optional\n" /etc/pacman.conf | |
- name: Update | |
continue-on-error: true | |
run: ./update.sh | |
- name: Kill | |
shell: cmd | |
run: | | |
"%windir%\SysWOW64\WindowsPowerShell\v1.0\PowerShell.exe" -NoProfile -ExecutionPolicy Bypass -Command "Get-Process | Where-Object { $_.Modules.ModuleName -contains 'msys-2.0.dll' } | Stop-Process -Force" | |
- name: Install special | |
if: ${{ github.event.inputs.install_extras != '' }} | |
run: pacman --noconfirm --noprogressbar -S --needed --overwrite '*' ${{ github.event.inputs.install_extras }} | |
- name: Kill 2 | |
if: ${{ github.event.inputs.install_extras != '' }} | |
shell: cmd | |
run: | | |
"%windir%\SysWOW64\WindowsPowerShell\v1.0\PowerShell.exe" -NoProfile -ExecutionPolicy Bypass -Command "Get-Process | Where-Object { $_.Modules.ModuleName -contains 'msys-2.0.dll' } | Stop-Process -Force" | |
- name: Auto-Rebase 1 | |
shell: cmd | |
run: | | |
call "${{ steps.msys2.outputs.msys2-location }}\autorebase.bat" | |
- name: Update again | |
run: ./update.sh | |
- name: Kill 3 | |
shell: cmd | |
run: | | |
"%windir%\SysWOW64\WindowsPowerShell\v1.0\PowerShell.exe" -NoProfile -ExecutionPolicy Bypass -Command "Get-Process | Where-Object { $_.Modules.ModuleName -contains 'msys-2.0.dll' } | Stop-Process -Force" | |
- name: Auto-Rebase 2 and subst | |
shell: cmd | |
run: | | |
del "${{ steps.msys2.outputs.msys2-location }}\etc\rebase.db.*" | |
call "${{ steps.msys2.outputs.msys2-location }}\autorebase.bat" | |
SUBST T: . | |
- name: Build32 | |
run: cd /t/ && ./build32.sh ${{ github.event.inputs.packages }} | |
- name: un-subst | |
if: ${{ always() }} | |
shell: cmd | |
continue-on-error: true | |
run: | | |
SUBST T: /D | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: packages | |
path: artifacts/ | |
staging: | |
permissions: | |
contents: write | |
needs: [ build32 ] | |
runs-on: ubuntu-latest | |
if: ${{ ! github.event.inputs.dont_upload || github.event.inputs.dont_upload == 'false' }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Upload to repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload "${{ github.event.inputs.release_name }}" packages/* --clobber -R "${{ github.repository }}" |