1
- # Hacked together from https://github.com/qemu-riscv-xpack/.github/workflows/build-all.yml
2
- # and https://github.com/palmetto/palm-cli/blob/develop/.github/workflows/pypi-deploy.yaml
1
+ # ==========================
2
+ # Can test locally using act (https://github.com/nektos/act)
3
+ # ==========================
4
+ # ./bin/act -s GITHUB_TOKEN=<fine-grained-token> --directory runner --workflows "../.github/workflows/" -e ../payloads.json --no-skip-checkout -j deploy
5
+ #
6
+ # where payloads.json is:
7
+ # {
8
+ # "inputs": {
9
+ # "tags": "2.47"
10
+ # }
11
+ # }
12
+ #
13
+ # ==========================
14
+ # Can debug remotely on github actions instance by uncommenting the 'tmate' section below
15
+ # ==========================
16
+
3
17
4
18
name : Deploy getssl
5
19
@@ -15,15 +29,33 @@ jobs:
15
29
deploy :
16
30
runs-on : ubuntu-latest
17
31
steps :
32
+ - name : prepare
33
+ # Keep the outputs persistent outside the docker container to use for the other steps
34
+ run : |
35
+ mkdir -p ${{ github.workspace }}/bin
36
+ mkdir -p ${{ github.workspace }}/debbuild/BUILD
37
+ mkdir -p ${{ github.workspace }}/debbuild/DEBS/all
38
+ mkdir -p ${{ github.workspace }}/debbuild/SDEBS
39
+ mkdir -p ${{ github.workspace }}/debbuild/SOURCES
40
+ mkdir -p ${{ github.workspace }}/debbuild/SPECS
41
+ mkdir -p ${{ github.workspace }}/rpmbuild/SOURCES
42
+ mkdir -p ${{ github.workspace }}/rpmbuild/RPMS/noarch
43
+ mkdir -p ${{ github.workspace }}/rpmbuild/RPMS/SRPMS
44
+
18
45
- name : Checkout
19
46
uses : actions/checkout@v3
20
47
with :
21
- path : " getssl "
48
+ path : source
22
49
23
50
- name : Get version number
24
51
id : get_version
25
52
run : |
26
- echo ::set-output name=VERSION::$(bash ./getssl/getssl --version)
53
+ echo "VERSION=$(bash ${{ github.workspace }}/source/getssl --version)" >> $GITHUB_OUTPUT
54
+
55
+ - name : Get release
56
+ id : get_release
57
+ run : |
58
+ echo "RELEASE=$(grep Release source/getssl.spec | awk '{ print $2 }')" >> $GITHUB_OUTPUT
27
59
28
60
- name : Check version matches tag
29
61
run : |
@@ -35,40 +67,47 @@ jobs:
35
67
- name : build .deb package
36
68
id : build_deb
37
69
run : |
38
- sudo apt-get update
39
- sudo apt-get install -y build-essential devscripts debhelper pax liblocale-gettext-perl
70
+ sudo apt-get update -qq
71
+ sudo apt-get install --no-install-recommends -qq - y build-essential devscripts debhelper pax liblocale-gettext-perl wget
40
72
wget https://github.com/debbuild/debbuild/releases/download/22.02.1/debbuild_22.02.1-0ubuntu20.04_all.deb
41
73
sudo dpkg --install debbuild_22.02.1-0ubuntu20.04_all.deb
42
74
# Line 1959 has an extra ")" bracket
43
- sudo patch /usr/bin/debbuild < ./getssl/debbuild.patch
44
- mkdir -p /root/debbuild/BUILD
45
- mkdir -p /root/debbuild/DEBS/all
46
- mkdir -p /root/debbuild/SDEBS
47
- mkdir -p /root/debbuild/SOURCES
48
- mkdir -p /root/debbuild/SPECS
49
- tar -czf /root/debbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz ./getssl/* --transform "s/getssl\//getssl-${{ github.event.inputs.tags }}\//"
50
- tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb /root/debbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz --transform 's,\.,SOURCES,'
51
- tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb -C ./getssl getssl.crontab getssl.logrotate --transform 's,^,SOURCES/,'
52
- tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb -C ./getssl getssl.spec --transform 's,^,SPECS/,'
53
- debbuild --install /root/getssl-${{ github.event.inputs.tags }}.sdeb
54
- debbuild -vv -ba /root/debbuild/SPECS/getssl.spec
75
+ sudo chmod +w /usr/bin/debbuild
76
+ sudo patch /usr/bin/debbuild < ${GITHUB_WORKSPACE}/source/debbuild.patch
77
+ tar --absolute-names -czf ${GITHUB_WORKSPACE}/getssl-${{ github.event.inputs.tags }}.tar.gz ${GITHUB_WORKSPACE}/source/* --transform "s,${GITHUB_WORKSPACE}/source,getssl-${{ github.event.inputs.tags }},"
78
+ tar --absolute-names -cf ${GITHUB_WORKSPACE}/debbuild/SDEBS/getssl-${{ github.event.inputs.tags }}.sdeb ${GITHUB_WORKSPACE}/getssl-${{ github.event.inputs.tags }}.tar.gz --transform "s,${GITHUB_WORKSPACE},SOURCES,"
79
+ tar --append -f ${GITHUB_WORKSPACE}/debbuild/SDEBS/getssl-${{ github.event.inputs.tags }}.sdeb -C ${GITHUB_WORKSPACE}/source getssl.crontab getssl.logrotate --transform 's,^,SOURCES/,'
80
+ tar --append -f ${GITHUB_WORKSPACE}/debbuild/SDEBS/getssl-${{ github.event.inputs.tags }}.sdeb -C ${GITHUB_WORKSPACE}/source getssl.spec --transform 's,^,SPECS/,'
81
+ ln -s ${GITHUB_WORKSPACE}/debbuild ${HOME}/debbuild
82
+ /usr/bin/debbuild -vv --install ${GITHUB_WORKSPACE}/debbuild/SDEBS/getssl-${{ github.event.inputs.tags }}.sdeb
83
+ /usr/bin/debbuild -vv -ba ${GITHUB_WORKSPACE}/debbuild/SPECS/getssl.spec
84
+ echo "getssl_deb=${GITHUB_WORKSPACE}/debbuild/DEBS/all/getssl_${{ github.event.inputs.tags }}-${{ steps.get_release.outputs.RELEASE }}_all.deb" >> $GITHUB_OUTPUT
85
+
86
+ # *** Uncomment this to debug remotely ***
87
+ # - name: Setup tmate session
88
+ # if: ${{ failure() }}
89
+ # uses: mxschmitt/action-tmate@v3
55
90
56
91
- name : build .rpm package
57
92
id : build_rpm
58
93
if : ${{ success() }}
59
94
uses : addnab/docker-run-action@v3
60
95
with :
61
96
image : rockylinux:8
62
- options : -v ${{ github.workspace }}:/root/getssl -e GITHUB_REF=${{ github.ref }}
97
+ options : -v ${{ github.workspace }}:/root -e GITHUB_REF=${{ github.ref }}
63
98
run : |
64
- sudo yum install -y rpm-build make
65
- mkdir -p /root/rpmbuild/SOURCES /root/rpmbuild/RPMS/SRPMS /root/rpmbuild/RPMS/noarch
66
- tar -czf /root/rpmbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz /root/getssl/* --transform "s/root\/getssl\//getssl-${{ github.event.inputs.tags }}\//"
67
- cp /root/getssl/getssl.crontab /root/rpmbuild/SOURCES
68
- cp /root/getssl/getssl.logrotate /root/rpmbuild/SOURCES
69
- rpmbuild -ba /root/getssl/getssl.spec
70
- cp /root/rpmbuild/SRPMS/getssl-*.rpm /root/getssl
71
- cp /root/rpmbuild/RPMS/noarch/getssl-*.rpm /root/getssl
99
+ yum install -y rpm-build make
100
+ tar -czf /root/rpmbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz /root/source/* --transform "s/root\/source\//getssl-${{ github.event.inputs.tags }}\//"
101
+ cp /root/source/getssl.crontab /root/rpmbuild/SOURCES
102
+ cp /root/source/getssl.logrotate /root/rpmbuild/SOURCES
103
+ rpmbuild -ba /root/source/getssl.spec
104
+
105
+ - name : output .rpm packages
106
+ id : output_rpm
107
+ if : ${{ success() }}
108
+ run : |
109
+ echo "getssl_rpm=${GITHUB_WORKSPACE}/rpmbuild/RPMS/noarch/getssl-${{ github.event.inputs.tags }}-${{ steps.get_release.outputs.RELEASE }}.noarch.rpm" >> $GITHUB_OUTPUT
110
+ echo "getssl_srpm=${GITHUB_WORKSPACE}/rpmbuild/SRPMS/getssl-${{ github.event.inputs.tags }}-${{ steps.get_release.outputs.RELEASE }}.src.rpm" >> $GITHUB_OUTPUT
72
111
73
112
- name : create_release
74
113
id : create_release
@@ -77,12 +116,12 @@ jobs:
77
116
env :
78
117
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79
118
with :
80
- tag : ${{ github.ref }}
81
- name : Draft Release ${{ github.ref }}
119
+ tag : ${{ github.event.inputs.tags }}
120
+ name : Draft Release ${{ github.event.inputs.tags }}
82
121
generateReleaseNotes : true
83
122
draft : true
84
123
prerelease : false
85
124
artifacts : |
86
- /root/debbuild/DEBS/all/getssl_ ${{ github.event.inputs.tags }}-*_all.deb
87
- /root/getssl- ${{ github.event.inputs.tags }}-*.src.rpm
88
- /root/getssl- ${{ github.event.inputs.tags }}-*.noarch.rpm
125
+ ${{ steps.build_deb.outputs.getssl_deb }}
126
+ ${{ steps.output_rpm.outputs.getssl_rpm }}
127
+ ${{ steps.output_rpm.outputs.getssl_srpm }}
0 commit comments