-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (134 loc) · 4.62 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
# GitHub Actions CI script for psx_mc_cli
# (C) 2022 Gavin Hayes
name: Build psx_mc_cli
on: [ push, pull_request ]
jobs:
#list:
# name: list available perl versions
# runs-on: ubuntu-latest
# steps:
# - uses: shogo82148/actions-setup-perl@v1
# - name: list available perl versions
# shell: perl {0}
# run: |
# use Actions::Core;
# print "linux version: $_\n" foreach(perl_versions(platform => 'linux'));
# print "windows version: $_\n" foreach(perl_versions(platform => 'win32'));
# print "strawberry windows version: $_\n" foreach(perl_versions(platform => 'win32', distribution => 'strawberry'));
build-linux:
name: Build PlayStation-MemoryCard, standalones, and ape release
runs-on: ubuntu-latest
steps:
- name: Fetch repo and submodules
uses: actions/checkout@v3
with:
path: 'psx_mc_cli'
submodules: true
- name: Install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.36'
install-modules-with: cpanm
install-modules: Perl::Dist::APPerl
- name: Test in-tree
run: |
cd psx_mc_cli/PlayStation-MemoryCard
prove -I../gifenc-pl/lib -lv t
- name: Build PlayStation-MemoryCard release
run: |
cd psx_mc_cli/PlayStation-MemoryCard
perl Makefile.PL
make manifest
make dist
mv PlayStation-MemoryCard-v*.tar.gz ../
- name: Build standalone release
run: |
cd psx_mc_cli
make standalone-all
- name: Load APE config
run: |
cd psx_mc_cli
echo "PERL_ID=$(apperlm get-config-key psx_mc_cli_with_perldoc perl_id)" >> $GITHUB_ENV
echo "COSMO_ID=$(apperlm get-config-key psx_mc_cli_with_perldoc cosmo_id)" >> $GITHUB_ENV
- name: Fetch Perl
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 psx_mc_cli.com
env:
CF_BY: ${{ secrets.CF_BY }}
CF_EMAIL: ${{ secrets.CF_EMAIL }}
run: |
cd psx_mc_cli
ls -la
apperlm install-build-deps -p ../perl5 -c ../cosmopolitan
apperlm checkout psx_mc_cli_with_perldoc
apperlm list
apperlm configure -Dcf_by="$CF_BY" -Dcf_email="$CF_EMAIL"
apperlm build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: psx_mc_cli-Perl
if-no-files-found: error
path: |
psx_mc_cli/PlayStation-MemoryCard-v*.tar.gz
psx_mc_cli/psx-mc-cli-v*-standalone.tar.gz
psx_mc_cli/psx-mc-cli-v*-standalone.zip
psx_mc_cli/psx_mc_cli.com
test-perl-release:
needs: [ build-linux ]
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
perl: [ '5.36', '5.34', '5.10' ]
runs-on: ${{ matrix.os }}
name: Test perl release with ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v3
- name: Rename to unversioned name
run: mv psx_mc_cli-Perl/PlayStation-MemoryCard-*.tar.gz PlayStation-MemoryCard.tar.gz
- name: Install Perl and PlayStation::MemoryCard using cpanm
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
install-modules-with: cpanm
install-modules: PlayStation-MemoryCard.tar.gz
- name: Try loading PlayStation::MemoryCard
run: |
perl -MPlayStation::MemoryCard -e 'print $PlayStation::MemoryCard::VERSION . "\n";'
- name: Archive CPAN logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: cpan_log
path: /home/runner/.cpanm/work/*/build.log
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [ build-linux, test-perl-release ]
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: |
psx_mc_cli-Perl/PlayStation-MemoryCard-v*.tar.gz
psx_mc_cli-Perl/psx-mc-cli-v*-standalone.*
psx_mc_cli-Perl/psx_mc_cli.com