-
Notifications
You must be signed in to change notification settings - Fork 1
191 lines (184 loc) · 5.96 KB
/
build.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
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
# 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@v3
with:
path: 'Perl-Dist-APPerl'
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.36'
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@v3
with:
name: cpan
if-no-files-found: error
path: Perl-Dist-APPerl-v*.tar.gz
build-apperl:
name: Build perl.com
runs-on: ubuntu-latest
needs: build-linux
strategy:
matrix:
config: [full, small, full-vista, small-vista]
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v3
- name: prepare for installing module
run: |
mv cpan/Perl-Dist-APPerl-v*.tar.gz Perl-Dist-APPerl.tar.gz
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.36'
install-modules-with: cpanm
install-modules: Perl-Dist-APPerl.tar.gz
- name: Load config
run: |
echo "PERL_ID=$(apperlm get-config-key ${{ matrix.config }} perl_id)" >> $GITHUB_ENV
echo "COSMO_ID=$(apperlm get-config-key ${{ matrix.config }} cosmo_id)" >> $GITHUB_ENV
echo "DEST_BIN=$(apperlm get-config-key ${{ matrix.config }} dest)" >> $GITHUB_ENV
echo "REL_NAME=APPerl-$(perl -MPerl::Dist::APPerl -e 'print $Perl::Dist::APPerl::VERSION')-${{ matrix.config }}.zip" >> $GITHUB_ENV
- name: Fetch Perl fork
uses: actions/checkout@v3
with:
repository: 'G4Vi/perl5'
ref: ${{ env.PERL_ID }}
path: 'perl5'
- name: Fetch cosmopolitan
uses: actions/checkout@v3
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: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config }}
if-no-files-found: error
path: |
${{ env.DEST_BIN }}
${{ env.DEST_BIN }}.dbg
${{ env.REL_NAME }}
test-Perl-Dist-APPerl:
name: test Perl-Dist-APPerl
runs-on: ubuntu-latest
needs: build-apperl
strategy:
matrix:
version: ['5.10', '5.36']
steps:
- name: Fetch repo
uses: actions/checkout@v3
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@v3
- name: Setup for tests
run: |
cd Perl-Dist-APPerl
cpanm --installdeps --notest .
mv ../full/perl.com* ./
chmod +x perl.com
mv ../small/perl-small.com* ./
mv ../full-vista/perl-vista.com* ./
mv ../small-vista/perl-small-vista.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@v3
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@v3
- 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 full/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@v3
- 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: |
cpan/Perl-Dist-APPerl-v*.tar.gz
full/*
small/*
full-vista/*
small-vista/*
APPerl-*-all.zip