Skip to content

chore: update flake.lock #114

chore: update flake.lock

chore: update flake.lock #114

Workflow file for this run

name: nixos lxc container generator
# Based on https://freddydumont.com/blog/nixos-github-actions
on:
workflow_call:
pull_request:
push:
branches:
- master
tags:
- "v*.*.*"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
# The following permissions are required for softprops/action-gh-release@v1.
permissions:
contents: write
jobs:
generate:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract tag name
run: |
tag_name="nightly"
case "$GITHUB_REF_NAME" in
v*.*.*)
tag_name="$GITHUB_REF_NAME"
;;
esac
echo "TAG_NAME=$tag_name" >> $GITHUB_ENV
- name: Install nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate NixOS configuration
run: |
nix run github:nix-community/nixos-generators -- -f proxmox-lxc --flake .#genericlxc | {
read path
echo "BUILD_PATH=$path" >> $GITHUB_ENV
}
- name: Modify file name
run: |
NEW_FILENAME="genericlxc-${{ env.TAG_NAME }}-$(basename ${{ env.BUILD_PATH }})"
RELEASE_PATH="${{ github.workspace }}/$NEW_FILENAME"
cp "${{ env.BUILD_PATH }}" "$RELEASE_PATH"
echo "FILENAME=$NEW_FILENAME" >> $GITHUB_ENV
echo "RELEASE_PATH=$RELEASE_PATH" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME }}
path: ${{ env.RELEASE_PATH }}
compression-level: 0 # File is already compressed
# Create a GitHub release and attach the generated container template.
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'push' }}
with:
name: ${{ env.TAG_NAME }}-genericlxc
files: ${{ env.RELEASE_PATH }}
prerelease: ${{ env.TAG_NAME == 'nightly' }}
tag_name: ${{ env.TAG_NAME }}