-
Notifications
You must be signed in to change notification settings - Fork 5
141 lines (120 loc) · 4.47 KB
/
build32.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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
- uses: jeremyd2019/setup-msys2@v2_32
with:
msystem: MSYS
install: git base-devel msys2-devel pactoys-git
update: true
bitness: 32
- name: Query MSYS2 root dir
id: msys2
shell: powershell
run: Write-Output ('rootdir={0}' -f (msys2 -c 'cygpath -w /')) >> $Env:GITHUB_OUTPUT
- 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.rootdir }}\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.rootdir }}\etc\rebase.db.*"
call "${{ steps.msys2.outputs.rootdir }}\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 }}"