netmaker/.github/workflows/packages.yml

47 lines
1.3 KiB
YAML
Raw Normal View History

2023-02-21 05:01:17 +08:00
name: Build linux packages
on:
workflow_call:
inputs:
version:
required: true
type: string
workflow_dispatch:
inputs:
version:
2023-02-23 09:25:06 +08:00
description: "netmaker version"
2023-02-21 05:01:17 +08:00
required: true
release:
types: [released]
jobs:
packages:
runs-on: ubuntu-latest
steps:
2023-02-23 09:25:06 +08:00
- name: setup ssh
2023-02-21 05:01:17 +08:00
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
2023-02-23 09:25:06 +08:00
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}
2023-02-21 05:01:17 +08:00
- name: apt/rpm
run: |
2023-02-24 05:11:57 +08:00
ssh fileserver.clustercat.com "cd packages/nmcli; export VERSION=${{ ENV.version }}; export REVISION=0; ./buildall.sh "