Skip to content

Commit

Permalink
Add flakehub push
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeChannings committed Sep 16, 2024
1 parent d7227d0 commit 1959849
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/flakehub-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Publish every Git push to main to FlakeHub"
on:
push:
branches:
- "main"

jobs:
flakehub-publish:
strategy:
matrix:
os: [macos-latest]
runs-on: ${{ matrix.os }}
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v4"
- uses: "DeterminateSystems/nix-installer-action@main"
- name: "Install direnv"
run: |
nix profile install nixpkgs#direnv
direnv allow
- name: "build"
run: |
nix build .#mkalias
# - uses: "DeterminateSystems/flakehub-push@main"
# with:
# name: "LukeChannings/toolbox"
# rolling: true
# visibility: "public"
# include-output-paths: true
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"aarch64-darwin"
"x86_64-darwin"

"x86_64-linux"
"aarch64-linux"
# "x86_64-linux"
# "aarch64-linux"
];

perSystem =
Expand Down
9 changes: 6 additions & 3 deletions packages/mkalias/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
stdenv,
lib,
swift,
swiftpm,
swiftpm2nix,
swiftPackages,
}:
let
# Pass the generated files to the helper.
generated = swiftpm2nix.helpers ./nix;
in
stdenv.mkDerivation {
swift.stdenv.mkDerivation {
pname = "mkalias";
version = "1.0.0";

# Foundation.NSURL on Linux does not support aliases
# https://github.com/apple/swift-corelibs-foundation/blob/main/Sources/Foundation/NSURL.swift#L1372
meta.platforms = lib.platforms.darwin;

src = ./.;

# Including SwiftPM as a nativeBuildInput provides a buildPhase for you.
Expand Down

0 comments on commit 1959849

Please sign in to comment.