This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
Rolling #50
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
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: "VyOS Rolling" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
branch: ["current", "sagitta"] | |
container: | |
image: vyos/vyos-build:${{ matrix.branch }} | |
options: --privileged | |
steps: | |
- name: Generate Token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: "${{ secrets.BOT_APP_ID }}" | |
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Setup variables | |
id: vars | |
shell: bash | |
run: | | |
build_date=$(date +%Y%m%d%H%M) | |
[[ "${{ matrix.branch }}" == "sagitta" ]] && vyos_version="1.4" || vyos_version="1.5" | |
echo "vyos-version=${vyos_version}" >> "$GITHUB_OUTPUT" | |
echo "tag-name=${vyos_version}-rolling-${build_date}" >> "$GITHUB_OUTPUT" | |
echo "iso-name=${vyos_version}-rolling-${build_date}-amd64" >> "$GITHUB_OUTPUT" | |
- name: Clone vyos-build | |
shell: bash | |
run: git clone -b ${{ matrix.branch }} --single-branch https://github.com/vyos/vyos-build | |
- name: Download sops deb | |
uses: robinraju/release-downloader@v1.10 | |
with: | |
repository: getsops/sops | |
latest: true | |
fileName: "*amd64.deb" | |
out-file-path: vyos-build/packages | |
- name: Download vyaml deb | |
uses: robinraju/release-downloader@v1.10 | |
with: | |
repository: p3lim/vyaml | |
latest: true | |
fileName: "*amd64.deb" | |
out-file-path: vyos-build/packages | |
- name: Configure | |
shell: bash | |
working-directory: vyos-build | |
run: | | |
sudo make clean | |
sudo ./build-vyos-image iso \ | |
--architecture amd64 \ | |
--build-by ${{ github.repository }} \ | |
--build-type release \ | |
--build-comment "VyOS with additional packages" \ | |
--version ${{ steps.vars.outputs.tag-name }} \ | |
--custom-package "age" \ | |
--custom-package "iptables" \ | |
--custom-package "jo" \ | |
--custom-package "moreutils" \ | |
--custom-package "tree" \ | |
--custom-package "vim" | |
- name: Create release with artifact | |
uses: ncipollo/release-action@v1 | |
with: | |
token: "${{ steps.app-token.outputs.token }}" | |
tag: "v${{ steps.vars.outputs.tag-name }}" | |
artifacts: "./vyos-build/build/vyos-${{ steps.vars.outputs.iso-name }}.iso" | |
artifactErrorsFailBuild: true | |
prerelease: true | |
body: | | |
Official VyOS Changelog: | |
https://docs.vyos.io/en/latest/changelog/${{ steps.vars.outputs.vyos-version }}.html | |
- name: Delete orphaned release | |
if: "${{ failure() }}" | |
uses: dev-drprasad/delete-tag-and-release@v0.2.1 | |
env: | |
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" | |
with: | |
tag_name: "v${{ steps.vars.outputs.tag-name }}" | |
delete_release: true |