From e73059640a908499155c3c81a896dfaaf516f21a Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 21 Aug 2023 20:14:50 -0700 Subject: [PATCH 1/2] Move configs into README --- README.md | 26 ++++++++++++++++++++++++++ flake.nix | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bee5292..45d7ca3 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,32 @@ jobs: visibility: "unlisted" # or "public" ``` +## Configuration + +Parameter | Description | Type | Required? | Default +:---------|:------------|:-----|:----------|:------- +`visibility` | `public` or `unlisted` | enum | ✅ | +`repository` | The GitHub repository containing your flake in the format of `{org}/{repo}`. | string | ✅ | `${{ github.repository }}` +`name` | The name of your published flake in the format of `{org}/{name}`. The `{org}` must match your organization's GitHub root name or the publish will fail. Specify this only if you want to publish under a different name from the `{org}/{repo}`. | string | | +`mirror` | Whether the repository is mirrored via DeterminateSystems' mirror functionality. This is only usable by DeterminateSystems. | Boolean | | `false` +`directory` | The path of your flake relative to the root of the repository. Useful for subflakes. | relative path | | +`tag` | The Git tag to use for non-rolling releases. This must be the character `v` followed by a SemVer version, such as `v0.1.1`. | string | | +`rolling` | For untagged releases, use a rolling versioning scheme. When this is enabled, the default versioning scheme is 0.1.[commit count]+rev-[git sha]. To customize the SemVer minor version, set the `rolling-minor` option. | Boolean | | `false` +`rolling-minor` | Specify the SemVer minor version of your rolling releases. All releases will follow the versioning scheme '0.[rolling-minor].[commit count]+rev-[git sha]' | string | | +`git-root` | The root directory of your Git repository. | relative path | | `.` +`extra-tags` | `flakehub-push` automatically uses the GitHub repo's topics as tags. This `extra-tags` parameter enables you to add extra tags beyond that as a comma-separated string. Only alphanumeric characters and hyphens are allowed in tags and the maximum length of tags is 50 characters. You can specify a maximum of 20 extra tags, and have a maximum of 25 tags, including those that we retrieve from GitHub. Any tags after the 25th will be ignored. | string | | `""` +`spdx-expression` | A valid SPDX license expression. This will be used in place of what GitHub claims your repository's `spdxIdentifier` is. | string | | `""` +`github-token` | The GitHub token for making authenticated GitHub API requests. | `${{ github.token }}` +`host` | The FlakeHub server to use | URL | | `https://api.flakehub.com` +`logger` | The logger to use. Options are `pretty`, `json`, `full` and `compact`. | enum | | `full` +`log-directives` | A comma-separated list of [tracing directives](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives). `-`s are replaced with `_`s (such as `nix_installer=trace`). | string | | `flakehub_push=info` +`flakehub-push-binary` | Run a version of the `flakehub-push` binary from somewhere already on disk. Conflicts with all other `flakehub-push-*` options. | string | | +`flakehub-push-branch` | The branch of `flakehub-push` to use. Conflicts with all other `flakehub-push-*` options. | string | | `main` +`flakehub-push-pr` | The pull request for `flakehub-push` to use. Conflicts with all other `flakehub-push-*` options. | integer | | +`flakehub-push-revision` | The revision of `flakehub-push` to use. Conflicts with all other `flakehub-push-*` options. | string | | +`flakehub-push-tag` | The tag of `flakehub-push` to use. Conflicts with all other `flakehub-push-*` options. | string | | | +`flakehub-push-url` | A URL pointing to a `flakehub-push` binary. Overrides all other `flakehub-push-*` options. | string | | | + ## Development against a local Flakehub server Assuming the dev environment is running as described in the flakehub repo: diff --git a/flake.nix b/flake.nix index 5d3c47f..cd3f0bb 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,6 @@ flakehub-push = inputs.self.packages.${final.stdenv.system}.flakehub-push; }; - packages = forAllSystems ({ system, pkgs, lib, ... }: let craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; From 4c3c49729f5e0d796528dbb05b898d99b275b2ab Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Tue, 22 Aug 2023 11:20:47 -0700 Subject: [PATCH 2/2] Change description --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 45d7ca3..3ce68e8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # `flakehub-push` -A [flakehub](https://flakehub.com/) pusher. +A GitHub Action for pushing [Nix flakes][flakes] to [FlakeHub]. +Write up a [YAML configuration](#configuration), push it to your repo, and you're ready to go. ## Example -The following workflow will push new tags matching the conventional format (eg. +This workflow pushes new tags matching the conventional format (eg. `v1.0.0`, `v0.1.0-rc4`) to Flakehub. ```yaml @@ -20,7 +21,7 @@ jobs: flakehub: runs-on: ubuntu-22.04 permissions: - id-token: write # Authenticate against FlakeHub + id-token: write # Necessary for authenticating against FlakeHub contents: read steps: - uses: DeterminateSystems/nix-installer-action@v4 @@ -28,7 +29,8 @@ jobs: - name: Push to flakehub uses: determinatesystems/flakehub-push@main with: - visibility: "unlisted" # or "public" + visibility: "public" # or "unlisted" if you don't want it to show up in + # search results and general listings on flakehub.com ``` ## Configuration @@ -71,3 +73,6 @@ cargo run -- \ --jwt-issuer-uri http://localhost:8081/jwt/token \ --host http://localhost:8080 ``` + +[flakehub]: https://flakehub.com +[flakes]: https://zero-to-nix.com/concepts/flakes