-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (139 loc) · 4.05 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
# GitHub Actions CI script for Extism and Alien-libextism
# (C) 2024 Dylibso
name: Build Extism and Alien-libextism
on: [ push, pull_request ]
jobs:
build-linux:
name: Build Extism and Alien-libextism
runs-on: ubuntu-latest
steps:
- name: Fetch repo
uses: actions/checkout@v3
with:
path: 'perl-sdk'
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.38'
working-directory: perl-sdk
install-modules-with: cpanm
install-modules-args: --with-develop --with-configure
- name: Build and install Alien-libextism
run: |
cd perl-sdk/Alien-libextism
perl Makefile.PL
make manifest
make distcheck
make dist
make install
mv *.tar.gz ../
- name: Install wasi-sdk
run: |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk_22.0_amd64.deb
sudo dpkg -i wasi-sdk_22.0_amd64.deb
- name: Build Extism
env:
WASI_SDK_PATH: /opt/wasi-sdk
run: |
cd perl-sdk
make wasm
cd Extism
perl Makefile.PL
make manifest
make distcheck
make dist
mv *.tar.gz ../
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dists
path: |
perl-sdk/*.tar.gz
test-install:
needs: [ build-linux ]
strategy:
matrix:
os: ['ubuntu-latest']
perl: ['5.16', '5.36', '5.38']
runs-on: ${{ matrix.os }}
name: Test install with ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v3
- name: Rename to unversioned name
run: |
mv dists/Alien-libextism*.tar.gz Alien-libextism.tar.gz
mv dists/Extism*.tar.gz Extism.tar.gz
- name: Install Perl and dists using cpanm
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
install-modules-with: cpanm
install-modules: Alien-libextism.tar.gz Extism.tar.gz
- name: Try loading Extism
run: |
perl -MExtism -e 'print $Extism::VERSION . "\n";'
- name: Archive CPAN logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: cpan_log
path: /home/runner/.cpanm/work/*/build.log
test-manual-install:
name: test manual install
runs-on: ubuntu-latest
needs: [ build-linux ]
strategy:
matrix:
version: ['5.16', '5.36', '5.38']
steps:
- name: Fetch repo
uses: actions/checkout@v3
with:
path: 'perl-sdk'
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.version }}
working-directory: perl-sdk
install-modules-with: cpanm
install-modules-args: --with-configure
- name: Fetch build artifacts
uses: actions/download-artifact@v3
- name: Build, Test, Install Alien-libextism.tar.gz
run: |
mv dists/Alien-libextism*.tar.gz Alien-libextism.tar.gz
tar xvf Alien-libextism.tar.gz
rm Alien-libextism.tar.gz
cd Alien-libextism*
perl Makefile.PL
make
make test
make install
- name: Build, Test, Install Extism.tar.gz
run: |
mv dists/Extism*.tar.gz Extism.tar.gz
tar xvf Extism.tar.gz
rm Extism.tar.gz
cd Extism*
perl Makefile.PL
make
make test
make install
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [ build-linux, test-install, test-manual-install ]
steps:
- name: Fetch build artifacts
if: ${{ github.ref_type == 'tag' }}
uses: actions/download-artifact@v3
- name: Publish release
if: ${{ github.ref_type == 'tag' }}
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
draft: true
files: |
dists/Alien-libextism-*.tar.gz
dists/Extism-*.tar.gz