1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-12-24 06:59:25 +08:00
NeoNetwork/.github/workflows/roa.yml
2020-06-04 11:53:59 +08:00

59 lines
2.1 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: roa_generator
on:
push:
branches: [master]
schedule:
- cron: "0 6 * * 1"
jobs:
build:
name: Generate ROA
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Install dependencies
shell: bash
run: |
sudo apt update -qq
sudo apt install -y python3 git openssh-client \
python3-toml python3-tabulate
- name: Run roa script
shell: bash
run: |
maxlen4=29
maxlen6=64
mkdir -p roa_dir
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json
python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json
python3 scripts/roa.py --summary --output roa_dir/README.txt
- name: Upload files
env:
SSHPRIVKEY: ${{ secrets.KEY }}
shell: bash
run: |
cd roa_dir
[ -n "$SSHPRIVKEY" ] || (echo SSHPRIVKEY is not set; exit 1)
( set -e;
mkdir -p ~/.ssh
echo "$SSHPRIVKEY" | base64 -d > ~/.ssh/id_ed25519
chmod 0600 ~/.ssh/id_ed25519
ssh -o StrictHostKeyChecking=no git@github.com || true
git init && git add .
git config user.name "neonet roa bot"
git config user.email "bot@github.com"
git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)"
git push --force --quiet "git@github.com:NeoCloud/NeoNetwork-ROA.git" HEAD:master
) || (shred ~/.ssh/id_ed25519; exit 1)
shred ~/.ssh/id_ed25519