Skip to content

Publish tags to FlakeHub #13

Publish tags to FlakeHub

Publish tags to FlakeHub #13

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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 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@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15
with:
name: catppuccin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
skipPush: ${{ github.ref != 'refs/heads/main' }}
- name: Parse the semver tag
id: semver
run: echo "${{ inputs.tag }}" | sed -E 's/.+-v?([0-9]+\.[0-9]+\.[0-9]+).*/tag=v\1/' >> $GITHUB_OUTPUT
- uses: DeterminateSystems/flakehub-push@main
with:
visibility: public
name: catppuccin/vscode
tag: ${{ steps.semver.outputs.tag }}