|
|
# Hacked together from https://github.com/qemu-riscv-xpack/.github/workflows/build-all.yml
|
|
|
# and https://github.com/palmetto/palm-cli/blob/develop/.github/workflows/pypi-deploy.yaml
|
|
|
|
|
|
name: Deploy getssl
|
|
|
|
|
|
on:
|
|
|
workflow_dispatch:
|
|
|
inputs:
|
|
|
tags:
|
|
|
description: 'Tag to deploy, e.g. 2.47'
|
|
|
required: true
|
|
|
type: boolean
|
|
|
|
|
|
jobs:
|
|
|
deploy:
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
- name: Checkout
|
|
|
uses: actions/checkout@v3
|
|
|
with:
|
|
|
path: "getssl"
|
|
|
|
|
|
- name: Get version number
|
|
|
id: get_version
|
|
|
run: |
|
|
|
echo ::set-output name=VERSION::$(bash ./getssl/getssl --version)
|
|
|
|
|
|
- name: Check version matches tag
|
|
|
run: |
|
|
|
if [ "${{ steps.get_version.outputs.VERSION }}" != "getssl V${{ github.event.inputs.tags }}" ]; then
|
|
|
echo "Version number in getssl (${{ steps.get_version.outputs.VERSION }}) does not match tag (getssl V${{ github.event.inputs.tags }})"
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
- name: build .deb package
|
|
|
id: build_deb
|
|
|
run: |
|
|
|
apt-get update
|
|
|
apt-get install -y build-essential devscripts debhelper pax liblocale-gettext-perl
|
|
|
wget https://github.com/debbuild/debbuild/releases/download/22.02.1/debbuild_22.02.1-0ubuntu20.04_all.deb
|
|
|
dpkg --install debbuild_22.02.1-0ubuntu20.04_all.deb
|
|
|
# Line 1959 has an extra ")" bracket
|
|
|
patch /usr/bin/debbuild < ./getssl/debbuild.patch
|
|
|
mkdir -p /root/debbuild/BUILD
|
|
|
mkdir -p /root/debbuild/DEBS/all
|
|
|
mkdir -p /root/debbuild/SDEBS
|
|
|
mkdir -p /root/debbuild/SOURCES
|
|
|
mkdir -p /root/debbuild/SPECS
|
|
|
tar -czf /root/debbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz ./getssl/* --transform "s/getssl\//getssl-${{ github.event.inputs.tags }}\//"
|
|
|
tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb /root/debbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz --transform 's,\.,SOURCES,'
|
|
|
tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb -C ./getssl getssl.crontab getssl.logrotate --transform 's,^,SOURCES/,'
|
|
|
tar --append -f /root/getssl-${{ github.event.inputs.tags }}.sdeb -C ./getssl getssl.spec --transform 's,^,SPECS/,'
|
|
|
debbuild --install /root/getssl-${{ github.event.inputs.tags }}.sdeb
|
|
|
debbuild -vv -ba /root/debbuild/SPECS/getssl.spec
|
|
|
|
|
|
- name: build .rpm package
|
|
|
id: build_rpm
|
|
|
if: ${{ success() }}
|
|
|
uses: addnab/docker-run-action@v3
|
|
|
with:
|
|
|
image: rockylinux:8
|
|
|
options: -v ${{ github.workspace }}:/root/getssl -e GITHUB_REF=${{ github.ref }}
|
|
|
run: |
|
|
|
yum install -y rpm-build make
|
|
|
mkdir -p /root/rpmbuild/SOURCES /root/rpmbuild/RPMS/SRPMS /root/rpmbuild/RPMS/noarch
|
|
|
tar -czf /root/rpmbuild/SOURCES/getssl-${{ github.event.inputs.tags }}.tar.gz /root/getssl/* --transform "s/root\/getssl\//getssl-${{ github.event.inputs.tags }}\//"
|
|
|
cp /root/getssl/getssl.crontab /root/rpmbuild/SOURCES
|
|
|
cp /root/getssl/getssl.logrotate /root/rpmbuild/SOURCES
|
|
|
rpmbuild -ba /root/getssl/getssl.spec
|
|
|
cp /root/rpmbuild/SRPMS/getssl-*.rpm /root/getssl
|
|
|
cp /root/rpmbuild/RPMS/noarch/getssl-*.rpm /root/getssl
|
|
|
|
|
|
- name: create_release
|
|
|
id: create_release
|
|
|
if: ${{ success() }}
|
|
|
uses: ncipollo/release-action@v1
|
|
|
env:
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
with:
|
|
|
tag: ${{ github.ref }}
|
|
|
name: Draft Release ${{ github.ref }}
|
|
|
generateReleaseNotes: true
|
|
|
draft: true
|
|
|
prerelease: false
|
|
|
artifacts: |
|
|
|
/root/debbuild/DEBS/all/getssl_${{ github.event.inputs.tags }}-*_all.deb
|
|
|
/root/getssl-${{ github.event.inputs.tags }}-*.src.rpm
|
|
|
/root/getssl-${{ github.event.inputs.tags }}-*.noarch.rpm
|