forked from vyos/vyos-1x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Kim] #0 initial github action for building vyos-1x debs
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
# This is a basic workflow to help you get started with Actions | ||
# rebased against upstream/current = e01283e75aaf21bc171b4aa791206b498380c1eb | ||
# previously rebased against dc5e42b9daa97a35ab9fa4cb473b62b7abb146da | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the current branch | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [ current ] | ||
pull_request: | ||
branches: [ current ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Runs a single command using the runners shell | ||
- name: Install docker and prerequisites | ||
run: | | ||
sudo apt update | ||
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
sudo apt update | ||
sudo apt install -y docker-ce docker-ce-cli containerd.io | ||
- name: Set VERSION variable | ||
run: | | ||
echo "VERSION=$(date +%Y%m%d%H%M)-transficc" >> $GITHUB_ENV | ||
- name: Build custom vyos-1x | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
docker run --rm --privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -v $GITHUB_WORKSPACE:/vyos/vyos-1x -w /vyos/vyos-1x vyos/vyos-build:current \ | ||
bash -c "sudo chmod 777 ../; ls -latr ../; make all; make deb; mv ../*.deb ." | ||
find . -name '*.deb' -ls | ||
echo "VYOS_1X_VERSION=$(find . -name 'vyos-1x_1*.deb' | cut -f2 -d_)" >> $GITHUB_ENV | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
release_name: Release ${{ env.VERSION }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload standard release asset | ||
id: upload-release-asset-1 | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. | ||
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./vyos-1x_${{ env.VYOS_1X_VERSION }}_amd64.deb | ||
asset_name: vyos-1x_${{ env.VYOS_1X_VERSION }}_amd64.deb | ||
asset_content_type: application/vnd.debian.binary-package |