netmaker/.github/workflows/packages.yml
Matthew R Kasun bc39f1bc3b workflows
2023-02-25 08:03:16 -05:00

47 lines
1.3 KiB
YAML

name: Build linux packages
on:
workflow_call:
inputs:
version:
required: true
type: string
workflow_dispatch:
inputs:
version:
description: "netmaker version"
required: true
release:
types: [released]
jobs:
packages:
runs-on: ubuntu-latest
steps:
- name: setup ssh
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/id_devops
chmod 600 ~/.ssh/id_devops
cat >>~/.ssh/config <<END
Host *.clustercat.com
User root
IdentityFile ~/.ssh/id_devops
StrictHostKeyChecking no
END
env:
SSH_KEY: ${{ secrets.TESTING_SSH_KEY }}
- name: set version
run: |
if [[ -n "${{ github.event.inputs.version }}" ]]; then
# remove everything but digits and . for package (deb, rpm, etc) versions
VERSION=$(echo ${{ github.event.inputs.version }} | tr -cd '[:digit:].')
else
VERSION=$(echo ${{ github.ref.name }} | tr -cd '[:digit:].')
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo ${VERSION}
- name: apt/rpm
run: |
ssh fileserver.clustercat.com "cd packages/nmcli; export VERSION=${{ ENV.version }}; export REVISION=0; ./buildall.sh "