Skip to content

Publish tags to FlakeHub #3

Publish tags to FlakeHub

Publish tags to FlakeHub #3

name: Publish tags to FlakeHub
on:
push:
tags:
- ".+-v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: The existing tag to publish to FlakeHub
type: string
required: true
jobs:
flakehub-publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Necessary for authenticating against FlakeHub
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
# use yarn-nixify to prepare the cache in /nix/store
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- run: yarn install --immutable
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Setup cachix
uses: cachix/cachix-action@v14
with:
name: catppuccin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
skipPush: ${{ github.ref != 'refs/heads/main' }}
- name: Parse the semver tag
id: semver
run: echo "tag=${GITHUB_REF#refs/tags/catppuccin-vsc-}" >> GITHUB_OUTPUT
- uses: DeterminateSystems/flakehub-push@main
with:
visibility: public
name: catppuccin/vscode
tag: ${{ steps.semver.outputs.tag }}