-
Notifications
You must be signed in to change notification settings - Fork 2
207 lines (200 loc) · 6.58 KB
/
Copy pathbuild.yml
File metadata and controls
207 lines (200 loc) · 6.58 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# GitHub Actions CI script for Perl-Dist-APPerl
# (C) 2022 Gavin Hayes
name: Build Actually Portable Perl
on: [ push, pull_request ]
jobs:
build-linux:
name: Build Perl-Dist-APPerl
runs-on: ubuntu-latest
steps:
- name: Fetch repo
uses: actions/checkout@v7
with:
path: 'Perl-Dist-APPerl'
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.42'
install-modules-with: cpanm
install-modules: File::ShareDir::Install
- name: Test in-tree
run: |
cd Perl-Dist-APPerl
prove -lv t
- name: Build Perl-Dist-APPerl release
run: |
cd Perl-Dist-APPerl
perl Makefile.PL
make manifest
make dist
mv Perl-Dist-APPerl-v*.tar.gz ../
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: cpan
if-no-files-found: error
path: Perl-Dist-APPerl-v*.tar.gz
archive: false
build-apperl:
name: Build perl.com
runs-on: ubuntu-latest
needs: build-linux
strategy:
matrix:
config: [full, small, full-vista, small-vista, full-536, small-536, full-540, small-540, full-542, small-542]
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v8
- name: prepare for installing module
run: |
mv Perl-Dist-APPerl-v*.tar.gz Perl-Dist-APPerl.tar.gz
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.42'
install-modules-with: cpanm
install-modules: Perl-Dist-APPerl.tar.gz
- name: Load config
run: |
PERL_ID=$(apperlm get-config-key ${{ matrix.config }} perl_id) && echo "PERL_ID=$PERL_ID" >> $GITHUB_ENV || true
COSMO_ID=$(apperlm get-config-key ${{ matrix.config }} cosmo_id) && echo "COSMO_ID=$COSMO_ID" >> $GITHUB_ENV || true
DEST_BIN=$(apperlm get-config-key ${{ matrix.config }} dest) && echo "DEST_BIN=$DEST_BIN" >> $GITHUB_ENV
REL_NAME=APPerl-$(perl -MPerl::Dist::APPerl -e 'print $Perl::Dist::APPerl::VERSION')-${{ matrix.config }}.zip && echo "REL_NAME=$REL_NAME" >> $GITHUB_ENV
- name: Fetch Perl fork
uses: actions/checkout@v7
if: env.PERL_ID != ''
with:
repository: 'G4Vi/perl5'
ref: ${{ env.PERL_ID }}
path: 'perl5'
- name: Fetch cosmopolitan
if: env.COSMO_ID != ''
uses: actions/checkout@v7
with:
repository: 'jart/cosmopolitan'
ref: ${{ env.COSMO_ID }}
path: 'cosmopolitan'
- name: support ape bins
run: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
- name: Configure and Build perl.com
env:
CF_BY: ${{ secrets.CF_BY }}
CF_EMAIL: ${{ secrets.CF_EMAIL }}
run: |
ls -la
apperlm install-build-deps -p perl5 -c cosmopolitan
apperlm init --name ${{ matrix.config }}
apperlm list
apperlm configure -Dcf_by="$CF_BY" -Dcf_email="$CF_EMAIL"
apperlm build
zip -r ${{ env.REL_NAME }} ${{ env.DEST_BIN }} ${{ env.DEST_BIN }}.dbg
- name: Run make test
run: |
dir=$(jq -r --arg cfg "${{ matrix.config }}" '.configs[$cfg].perl_build_dir' .apperl/user-project.json)
echo "$dir"
make -C $dir test 2>&1 | tee ${{ matrix.config }}-make-test.log
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.config }}
if-no-files-found: error
path: |
${{ env.DEST_BIN }}
${{ env.DEST_BIN }}.dbg
${{ env.REL_NAME }}
${{ matrix.config }}-make-test.log
test-Perl-Dist-APPerl:
name: test Perl-Dist-APPerl
runs-on: ubuntu-latest
needs: build-apperl
strategy:
matrix:
version: ['5.10', '5.36', '5.38', '5.40', '5.42']
steps:
- name: Fetch repo
uses: actions/checkout@v7
with:
path: 'Perl-Dist-APPerl'
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.version }}
install-modules-with: cpanm
install-modules: B::Keywords HTTP::Tiny Test::Pod::LinkCheck::Lite
- name: download build artifacts
uses: actions/download-artifact@v8
with:
merge-multiple: true
- name: Setup for tests
run: |
cd Perl-Dist-APPerl
cpanm --installdeps --notest .
mv ../*.com* ./
chmod +x perl.com
sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
- name: Run tests
run: |
cd Perl-Dist-APPerl
perl Makefile.PL
make
make authortest
- name: Archive CPAN logs
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: cpan_log
path: /home/runner/.cpanm/work/*/build.log
test-nobuild-builds:
name: Test building nobuild configs
needs: build-apperl
strategy:
matrix:
os: [ubuntu-latest] #, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v8
with:
merge-multiple: true
- name: support ape bins
run: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
- name: Try nobuild build
run: |
mkdir src
cp perl.com src/
chmod +x src/perl.com
src/perl.com /zip/bin/apperlm list
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [ build-linux, build-apperl, test-Perl-Dist-APPerl, test-nobuild-builds ]
steps:
- name: Fetch build artifacts
if: ${{ github.ref_type == 'tag' }}
uses: actions/download-artifact@v8
- name: Build binary amalgamation for uploading to microsoft
if: ${{ github.ref_type == 'tag' }}
run: |
sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
chmod +x full/perl.com
REL_NAME=APPerl-$(full/perl.com -MPerl::Dist::APPerl -e 'print $Perl::Dist::APPerl::VERSION')-all.zip
zip -r $REL_NAME */*.com*
- name: Publish release
if: ${{ github.ref_type == 'tag' }}
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
draft: true
files: |
Perl-Dist-APPerl-v*.tar.gz/Perl-Dist-APPerl-v*.tar.gz
full/*
small/*
full-vista/*
small-vista/*
full-536/*
small-536/*
full-540/*
small-540/*
full-542/*
small-542/*
APPerl-*-all.zip