This repository has been archived by the owner on May 1, 2024. It is now read-only.
VyOS Rolling (1.4) #51
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
--- | |
name: VyOS Rolling (1.4) | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 30 6 1,15 * * | |
env: | |
VYOS_URL: https://git.samipsolutions.fi/vyos/vyos-build-custom | |
VYOS_BRANCH: sagitta | |
VYOS_ARCH: amd64 | |
VYOS_BUILD_BY: [email protected] | |
VYOS_BUILD_TYPE: release | |
VYOS_VERSION: 1.4-rolling | |
jobs: | |
release: | |
runs-on: arc-sol | |
permissions: | |
# Need permission to write to the Releases tab now. | |
# https://github.com/ncipollo/release-action/issues/208. | |
contents: write | |
container: | |
image: vyos/vyos-build:sagitta | |
options: --privileged | |
steps: | |
- name: Generate Token | |
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0 | |
id: generate-token | |
with: | |
app_id: "${{ secrets.BOT_APP_ID }}" | |
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Setup variables | |
id: vars | |
run: | | |
build_date=$(date -u +%d%m%YT%H%M) | |
echo "tag-name=${{ env.VYOS_VERSION }}-${build_date}" >> "$GITHUB_OUTPUT" | |
echo "iso-name=${{ env.VYOS_VERSION }}-${build_date}-${{ env.VYOS_ARCH }}" >> "$GITHUB_OUTPUT" | |
- name: Clone vyos-build | |
run: git clone -b ${{ env.VYOS_BRANCH }} --single-branch ${{ env.VYOS_URL }} vyos-build | |
- name: Download sops deb | |
uses: robinraju/release-downloader@768b85c8d69164800db5fc00337ab917daf3ce68 # v1.7 | |
with: | |
repository: mozilla/sops | |
latest: true | |
fileName: "*amd64.deb" | |
out-file-path: vyos-build/packages | |
- name: Configure | |
working-directory: vyos-build | |
run: | | |
sudo make clean | |
sudo mkdir -p build | |
sudo ./build-vyos-image iso \ | |
--architecture ${{ env.VYOS_ARCH }} \ | |
--build-by ${{ env.VYOS_BUILD_BY }} \ | |
--build-type ${{ env.VYOS_BUILD_TYPE }} \ | |
--build-comment "VyOS with additional packages" \ | |
--version ${{ steps.vars.outputs.tag-name }} \ | |
--custom-package "git" \ | |
--custom-package "iptables" \ | |
--custom-package "jo" \ | |
--custom-package "vim" \ | |
--custom-package "moreutils" \ | |
--custom-package "python3-venv" \ | |
--custom-package "tree" \ | |
--custom-package "age" | |
- name: Create release with artifact | |
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
tag: "v${{ steps.vars.outputs.tag-name }}" | |
artifacts: "./vyos-build/build/vyos-${{ steps.vars.outputs.iso-name }}.iso" | |
artifactErrorsFailBuild: true | |
body: | | |
Official VyOS Changelog: | |
https://docs.vyos.io/en/latest/changelog/1.4.html | |
- name: Delete orphaned release | |
if: failure() | |
uses: dev-drprasad/delete-tag-and-release@5eafd8668311bf3e4d6c1e9898f32a317103de68 # v0.2.1 | |
env: | |
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}" | |
with: | |
tag_name: "v${{ steps.vars.outputs.tag-name }}" | |
delete_release: true | |
- name: Remove old releases | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 120 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}" |