Skip to content

Commit

Permalink
Update publish docs for non-tagged releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kip93 committed Nov 5, 2023
1 parent 37e2979 commit ea7fb4e
Showing 1 changed file with 52 additions and 9 deletions.
61 changes: 52 additions & 9 deletions frontend/src/Pages/Publish.elm
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,33 @@ page =
[ Flakestry.Layout.viewNav
, main_ []
[ div
[ class "container px-4 max-w-5xl" ]
[ class "container px-4 py-24 max-w-5xl" ]
[ h1
[ class "py-24 text-4xl font-semibold md:text-center"
]
[ class "text-4xl font-semibold md:text-center" ]
[ text "Publish your Flake" ]
, p
[ class "mt-6 text-l text-slate-600" ]
[ text """
Currently it's possible to publish flakes via GitHub actions.
Here're a few examples on how to make use of it to release your very own flakes.
""" ]
, h2
[ class "max-w-3xl flex items-center pt-12 text-2xl text-slate-900 font-semibold py-4" ]
[ text "Publish your Flake for each tag" ]
, File.defaultOptions
|> File.fileName ".github/workflows/publish.yaml"
|> File.language "yaml"
|> File.contents publishFlakeYaml
|> File.setCopyableContents (Just publishFlakeYaml)
|> File.contents publishTaggedFlakeYaml
|> File.setCopyableContents (Just publishTaggedFlakeYaml)
|> File.view
, h2
[ class "max-w-3xl flex items-center pt-12 text-2xl text-slate-900 font-semibold py-4" ]
[ text "Publish your Flake for each push to the default branch" ]
, File.defaultOptions
|> File.fileName ".github/workflows/publish.yaml"
|> File.language "yaml"
|> File.contents publishRollingFlakeYaml
|> File.setCopyableContents (Just publishRollingFlakeYaml)
|> File.view
]
]
Expand All @@ -33,14 +50,14 @@ page =
}


publishFlakeYaml : String
publishFlakeYaml =
publishTaggedFlakeYaml : String
publishTaggedFlakeYaml =
"""name: "Publish a flake to flakestry"
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
Expand All @@ -58,3 +75,29 @@ jobs:
with:
version: "${{ inputs.tag || github.ref_name }}"
"""


publishRollingFlakeYaml : String
publishRollingFlakeYaml =
"""name: "Publish a flake to flakestry"
on:
push:
branches:
- main
workflow_dispatch:
inputs:
ref:
description: "The existing reference to publish"
type: "string"
required: true
jobs:
publish-flake:
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
steps:
- uses: flakestry/flakestry-publish@main
with:
ref: "${{ inputs.ref || github.ref }}"
"""

0 comments on commit ea7fb4e

Please sign in to comment.