From 45965e113f4dc63d6ff903ef08fc5ec410b963e3 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 20 May 2024 22:25:34 -0600 Subject: [PATCH] ci: publish to flake registries on tag (#183) --- .github/workflows/publish.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..f45afdbf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,49 @@ +name: Publish flake + +on: + push: + tags: ["v*.*.*"] + workflow_dispatch: + inputs: + tag: + description: "The tag to publish" + type: string + required: true + +jobs: + flakehub: + name: FlakeHub + + runs-on: ubuntu-latest + + permissions: + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} + + - name: Install Nix + uses: cachix/install-nix-action@V27 + + - name: Push to FlakeHub + uses: DeterminateSystems/flakehub-push@v3 + with: + tag: ${{ inputs.tag || github.ref_name }} + visibility: "public" + + flakestry: + name: Flakestry + + runs-on: ubuntu-latest + + permissions: + id-token: write + + steps: + - name: Publish on Flakestry + uses: flakestry/flakestry-publish@main + with: + version: ${{ inputs.tag || github.ref_name }}