-
-
Notifications
You must be signed in to change notification settings - Fork 6
184 lines (169 loc) · 5.82 KB
/
linux.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
name: build on linux
on:
pull_request:
paths:
- "versions/linux.json"
- "scripts/linux/**"
- "scripts/lib/Devel/**"
- ".github/workflows/linux.yml"
- ".github/build-openssl-linux.sh"
push:
branches:
- "releases/*"
workflow_dispatch:
inputs:
perl-versions:
description: perl versions to build (JSON Array)
required: false
default: ""
jobs:
list:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- id: set-matrix
name: list available perl versions
run: |
if [ -n "$PERL_VERSIONS" ]; then
echo "matrix=$(printenv PERL_VERSIONS | jq -c '{perl: .}')" >> "$GITHUB_OUTPUT"
else
echo "matrix=$(<versions/linux.json jq -c '{perl: .}')" >> "$GITHUB_OUTPUT"
fi
env:
PERL_VERSIONS: ${{ github.event.inputs.perl-versions }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
sanity-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- id: perl
name: check pre-installed perl version
run: |
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: scripts/linux/local
key: Linux-sanity-check-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/linux/cpanfile.snapshot') }}
restore-keys: Linux-sanity-check-perl-${{ steps.perl.outputs.version }}-
- name: sanity check
run: |
../../bin/carton install --deployment
../../bin/carton exec perl -c build.pl
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/GitHubActions.pm
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/MinGW.pm
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/MinGWGNUmakefile.pm
working-directory: ./scripts/linux
env:
PERL5LIB: ${{ github.workspace }}/scripts/lib
build:
runs-on: ubuntu-20.04
needs:
- list
- sanity-check
permissions:
contents: write
id-token: write
attestations: write
timeout-minutes: 25
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix)}}
env:
PERL_VERSION: ${{ matrix.perl }}
steps:
- uses: actions/checkout@v4
- id: perl
name: setup host perl
run: |
perl -MConfig -E 'say "$Config{bin}"' >> "$GITHUB_PATH"
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- name: Host perl -V
run: perl -V
- name: gcc --version
run: gcc --version
- name: build OpenSSL
run: .github/build-openssl-linux.sh
- uses: actions/cache@v4
with:
path: scripts/linux/local
key: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/linux/cpanfile.snapshot') }}
restore-keys: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-
- name: carton install --deployment
shell: bash
run: ../../bin/carton install --deployment
working-directory: ./scripts/linux
- name: build
shell: bash
run: perl build.pl
env:
PERL5LIB: ${{ github.workspace }}/scripts/linux/local/lib/perl5
working-directory: ./scripts/linux
- name: upload
run: |
ACTIONS_VERSION=v$(<"$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/perl.tar.zstd" "$RUNNER_TEMP/perl-$PERL_VERSION-linux-x64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/perl-$PERL_VERSION-linux-x64.tar.zstd"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ runner.temp }}/*.tar.zstd
build-multi-thread:
runs-on: ubuntu-20.04
needs:
- sanity-check
- list
permissions:
contents: write
id-token: write
attestations: write
timeout-minutes: 25
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix)}}
env:
PERL_VERSION: ${{ matrix.perl }}
PERL_MULTI_THREAD: "1"
steps:
- uses: actions/checkout@v4
- id: perl
name: setup host perl
run: |
perl -MConfig -E 'say "$Config{bin}"' >> "$GITHUB_PATH"
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- name: Host perl -V
run: perl -V
- name: gcc --version
run: gcc --version
- name: build OpenSSL
run: .github/build-openssl-linux.sh
- uses: actions/cache@v4
with:
path: scripts/linux/local
key: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/linux/cpanfile.snapshot') }}
restore-keys: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-
- name: carton install --deployment
shell: bash
run: ../../bin/carton install --deployment
working-directory: ./scripts/linux
- name: build
shell: bash
run: perl build.pl
env:
PERL5LIB: ${{ github.workspace }}/scripts/linux/local/lib/perl5
working-directory: ./scripts/linux
- name: upload
run: |
ACTIONS_VERSION=v$(<"$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/perl.tar.zstd" "$RUNNER_TEMP/perl-$PERL_VERSION-linux-x64-multi-thread.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/perl-$PERL_VERSION-linux-x64-multi-thread.tar.zstd"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ runner.temp }}/*.tar.zstd