diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 775e4c6..978a6be 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,11 +6,6 @@ jobs: runs-on: ubuntu-latest container: docker.io/jcollie/nixos-runner:latest steps: - - run: ldd /__e/node16/bin/node - - run: echo "ld-library-path=${LD_LIBRARY_PATH}" >> $GITHUB_OUTPUT - id: ld-library-path - uses: actions/checkout@v3 - env: - LD_LIBRARY_PATH: ${{ steps.ld-library-path.outputs.ld-library-path }} - run: nix -L build .#nixos-runner - run: nix run .#push-container -- result --registry ghcr.io --repository jcollie/nixos-runner diff --git a/flake.nix b/flake.nix index 90b9080..2b17810 100644 --- a/flake.nix +++ b/flake.nix @@ -378,21 +378,10 @@ }; }; apps = { - push-container = - let - script = pkgs.writeTextFile { - name = "push-container"; - text = lib.concatStringsSep "\n" [ - "#!${pkgs.nushell}/bin/nu" - (builtins.readFile ./push-container.nu) - ]; - executable = true; - }; - in - { - type = "app"; - program = "${script}"; - }; + push-container = { + type = "app"; + program = "${self.packages.${system}.push-container}/bin/push-container"; + }; }; } ) diff --git a/push-container.nu b/push-container.nu index 564de6a..18553bd 100644 --- a/push-container.nu +++ b/push-container.nu @@ -24,24 +24,24 @@ def main [ $tags } - let tags = if ( - (not $no_drone_tag) - and - (not ($env | get -i DRONE_BUILD_NUMBER | is-empty)) - and - (not ($env | get -i DRONE_COMMIT_SHA | is-empty)) - ) { - $tags | append $"($env.DRONE_BUILD_NUMBER)-($env.DRONE_COMMIT_SHA | str substring 0..8)" - } else { - $tags - } - let tags = if ( (not $no_github_tag) and (not ($env | get -i GITHUB_RUN_NUMBER | is-empty)) and (not ($env | get -i GITHUB_SHA | is-empty)) + ) { + $tags | append $"($env.GITHUB_RUN_NUMBER)-($env.GITHUB_SHA | str substring 0..8)" + } else { + $tags + } + + let tags = if ( + (not $no_drone_tag) + and + (not ($env | get -i DRONE_BUILD_NUMBER | is-empty)) + and + (not ($env | get -i DRONE_COMMIT_SHA | is-empty)) ) { $tags | append $"($env.DRONE_BUILD_NUMBER)-($env.DRONE_COMMIT_SHA | str substring 0..8)" } else {