From 592994d2e1a1f796454a21a05d18495489335e8e Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 20 Feb 2025 17:15:51 -0500 Subject: [PATCH] Fixup the release workflow --- .github/workflows/publish.yml | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 839ace594..00ca3ec53 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,20 +1,23 @@ -name: Publish on FlakeHub +name: Release on: - push: - tags: - - "v*.*.*" + release: + types: + - released -publish: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: "DeterminateSystems/flakehub-push@main" - with: - visibility: "private" - name: "DeterminateSystems/nix-priv" - tag: "${{ github.ref_name }}" +jobs: + publish: + if: (!github.repository.fork && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/'))) + environment: ${{ github.event_name == 'release' && 'production' || '' }} + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: "DeterminateSystems/flakehub-push@main" + with: + rolling: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + visibility: "private" + tag: "${{ github.ref_name }}"