Skip to content

Commit

Permalink
Add a GH workflow for publishing to Hackage (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Mar 9, 2024
2 parents 803875e + fccabef commit f80a4e8
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
1 change: 1 addition & 0 deletions .config/project/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

imports = [
./github-ci.nix
./hackage-publish.nix
./hlint.nix
];

Expand Down
48 changes: 48 additions & 0 deletions .config/project/hackage-publish.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
pkgs,
self,
...
}: {
services.github.workflow."hackage-publish.yml".text = lib.generators.toYAML {} {
name = "Publish release to Hackage";
on = {
push.tags = ["v?[0-9]+.[0-9]+.[0-9]+*"];
workflow_dispatch.inputs.tag = {
description = "The existing version to publish to Hackage";
type = "string";
required = true;
};
};
jobs.hackage-publish = {
runs-on = "ubuntu-latest";
permissions = {
id-token = "write";
contents = "read";
};
steps = [
{
uses = "actions/checkout@v4";
"with".ref = "\${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}";
}
{
uses = "haskell-actions/setup@v2";
id = "setup-haskell-cabal";
"with" = {
ghc-version = lib.last self.lib.nonNixTestedGhcVersions;
cabal-version = pkgs.cabal-install.version;
};
}
{run = "cabal v2-sdist all";}
{
uses = "haskell-actions/hackage-publish@v1";
"with" = {
hackageToken = "\${{ secrets.HACKAGE_AUTH_TOKEN }}";
packagesPath = "\${{ runner.temp }}/dist-newstyle/sdist/"
publish = false;
};
}
];
};
};
}
1 change: 1 addition & 0 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/hackage-publish.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions containers/yaya-containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ build-type: Custom
license: AGPL-3.0-or-later
license-files:
LICENSE
extra-source-files:
CHANGELOG.md
README.md
tested-with:
GHC == {
-- GHCup Nixpkgs
Expand Down
3 changes: 0 additions & 3 deletions quickcheck/yaya-quickcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ build-type: Custom
license: AGPL-3.0-or-later
license-files:
LICENSE
extra-source-files:
CHANGELOG.md
README.md
tested-with:
GHC == {
-- GHCup Nixpkgs
Expand Down

0 comments on commit f80a4e8

Please sign in to comment.