This repository has been archived by the owner on May 1, 2024. It is now read-only.
forked from 9l/vyos-build-action
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.92 KB
/
vyos-v1.4-rolling-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: VyOS v1.4 Rolling Release
on:
#schedule:
# - cron: 0 3 * * *
push:
tags:
- 'v1.4.*'
env:
GIT_CLONE_URL: https://github.com/vyos/vyos-build
BRANCH: current
ARCHITECTURE: amd64
BUILD_BY: [email protected]
BUILD_TYPE: release
VERSION: 1.4-rolling
DEBIAN_MIRROR: http://ftp.us.debian.org/debian/
jobs:
build:
runs-on: ubuntu-latest
container:
image: vyos/vyos-build:current
options: --workdir /vyos --privileged
steps:
- name: Clone source code
run: git clone -b $BRANCH --single-branch $GIT_CLONE_URL
- name: Build ISO
working-directory: ./vyos-build
run: |
sudo make clean
sudo ./build-vyos-image iso --architecture $ARCHITECTURE --build-by $BUILD_BY --build-type $BUILD_TYPE --version $VERSION-$(date +%Y%m%d%H%M)
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: vyos-${{ env.VERSION }}-${{ env.ARCHITECTURE }}-iso
path: vyos-build/build/vyos-${{ env.VERSION }}-*.iso
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: vyos-${{ env.VERSION }}-${{ env.ARCHITECTURE }}-iso
path: vyos-${{ env.VERSION }}-${{ env.ARCHITECTURE }}-iso
- name: Upload release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
asset=$(find ./vyos-${{ env.VERSION }}-${{ env.ARCHITECTURE }}-iso/ -name "vyos-${{ env.VERSION }}-*.iso" | xargs)
tag_name="v${{ env.VERSION }}"
hub release edit -a "$asset" -m "" "$tag_name"
delete_old_workflow_runs:
needs: release
runs-on: ubuntu-latest
steps:
- name: Delete old workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 31