-
Notifications
You must be signed in to change notification settings - Fork 37
171 lines (164 loc) · 7.09 KB
/
github-build-ubuntu-latest.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
name: GitHub Build Ubuntu Latest
run-name: ${{ github.actor }} build of pkcs11-tools using GitHub Actions
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'info'
type: choice
options:
- info
- warning
- debug
jobs:
build-pkcs11-tools-oel-7:
runs-on: ubuntu-latest
container:
image: oraclelinux:7
steps:
- name: enable additional repositories
# https://docs.oracle.com/en/operating-systems/oracle-linux/scl-user/scl-ReleaseNotes.html#ol-scl-install-swc
# seems to require a OEL7 premium support subscription
# switch to IUS https://ius.io/setup
# yum install \
# https://repo.ius.io/ius-release-el7.rpm \
# https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
run: |
yum install -y yum-utils
yum install -y oraclelinux-developer-release-el7
yum install -y oracle-epel-release-el7
echo "Enabling OEL7 Addons repo"
yum-config-manager --enable ol7_addons
echo "Enabling OEL7 Latest and Optional Latest repo"
yum-config-manager --enable ol7_latest ol7_optional_latest
echo "Enabling OEL7 Software Collections repo"
yum-config-manager --enable ol7_software_collections
echo "Enabling https://www.softwarecollections.org/en/scls/rhscl/rh-git29/ repo"
yum install -y scl-utils
yum-config-manager --enable rhel-server-rhscl-7-rpms
echo "REPOLIST is:"
yum install -y https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum repolist
- name: install build dependencies
run: |
yum remove -y git
yum install -y openssl11 openssl11-devel git236 autoconf libtool autoconf-archive bison flex make perl rpm-build pkg-config
- uses: actions/checkout@v3
- name: make pkcs11-tools checkout directory acceptable for git
run: git config --global --add safe.directory /__w/pkcs11-tools/pkcs11-tools
- name: make bootstrap.sh executable
run: chmod +x bootstrap.sh
- name: run bootstrap.sh
run: ./bootstrap.sh
- name: run configure script
run: ./configure
- name: make source distribution tar archive
run: make dist
- name: create RPMs
run: |
export HOME=/__w/pkcs11-tools/
mkdir -p $HOME/rpmbuild/SPECS
mkdir -p $HOME/rpmbuild/SOURCES
cp dist/redhat/pkcs11-tools.spec $HOME/rpmbuild/SPECS
cp pkcs11-tools-*.tar.gz $HOME/rpmbuild/SOURCES
rpmbuild -ba $HOME/rpmbuild/SPECS/pkcs11-tools.spec
- name: list release files
run: |
find /__w/pkcs11-tools/rpmbuild/SRPMS/ -type f
find /__w/pkcs11-tools/rpmbuild/RPMS/ -type f
- name: upload pkcs11-tools RPMs to releases
# see https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Oracle Enterprise Linux 7
files: |
/__w/pkcs11-tools/rpmbuild/SRPMS/pkcs11-tools-*.src.rpm
/__w/pkcs11-tools/rpmbuild/RPMS/x86_64/pkcs11-tools-*x86_64.rpm
build-pkcs11-tools-oel-8:
runs-on: ubuntu-latest
container:
image: oraclelinux:8
steps:
- name: enable additional repositories for autoconf-archive and rpmbuild
run: |
dnf config-manager --set-enabled ol8_codeready_builder
dnf config-manager --set-enabled ol8_appstream
- name: install build dependencies
run: dnf install openssl-devel git clang autoconf libtool autoconf-archive bison flex make pkg-config perl rpm-build
- uses: actions/checkout@v3
- name: make pkcs11-tools checkout directory acceptable for git
run: git config --global --add safe.directory /__w/pkcs11-tools/pkcs11-tools
- name: make bootstrap.sh executable
run: chmod +x bootstrap.sh
# debugging autoconf and pkg-config due to error
# configure.ac "error: possibly undefined macro: AC_MSG_WARN"
# resolution was to enable autoconf-archive repo - see above
# - name: print autoconf version
# run: autoconf --version && rpm -qi autoconf
# - name: print pkg-config version
# run: pkg-config --version && rpm -qi pkgconf-pkg-config
- name: run bootstrap.sh
run: ./bootstrap.sh
- name: run configure script
run: ./configure
# remove make from this build as we don't need the binaries, they will be compiled by rpmbuild in the "create RPMs" step below
# - name: make
# run: make
- name: make source distribution tar archive
run: make dist
- name: create RPMs
run: |
export HOME=/__w/pkcs11-tools/
mkdir -p $HOME/rpmbuild/SPECS
mkdir -p $HOME/rpmbuild/SOURCES
dnf builddep -y dist/redhat/pkcs11-tools.spec
cp dist/redhat/pkcs11-tools.spec $HOME/rpmbuild/SPECS
cp pkcs11-tools-*.tar.gz $HOME/rpmbuild/SOURCES
rpmbuild -ba $HOME/rpmbuild/SPECS/pkcs11-tools.spec
# - name: list release files
# run: |
# find /__w/pkcs11-tools/rpmbuild/SRPMS/ -type f
# find /__w/pkcs11-tools/rpmbuild/RPMS/ -type f
- name: upload pkcs11-tools RPMs to releases
# see https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Oracle Enterprise Linux 8
files: |
/__w/pkcs11-tools/rpmbuild/SRPMS/pkcs11-tools-*.el8.src.rpm
/__w/pkcs11-tools/rpmbuild/RPMS/x86_64/pkcs11-tools-*.el8.x86_64.rpm
build-pkcs11-tools-ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install build dependencies
run: NEEDRESTART_MODE=l sudo apt -y install libssl-dev git clang autoconf libtool autoconf-archive bison flex make pkg-config perl
- name: make bootstrap.sh executable
run: chmod +x bootstrap.sh
- name: run bootstrap.sh
run: ./bootstrap.sh
- name: run configure script
run: ./configure --prefix=$PWD
- name: make source distribution tar archive
run: make dist
- name: make binary distribution tar archive
run: |
make install
strip bin/* || true # strip does not work on the bash scripts and returns non-zero exit code
make dist-bin
gzip pkcs11-tools-bin*
- name: list release files
run: ls pkcs11-tools-*tar*
- name: upload pkcs11-tools.tar.gz to releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: pkcs11-tools-*tar*