Skip to content

Commit

Permalink
Bump the npm-dependencies group with 30 updates (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored May 31, 2024
1 parent 1194e7b commit a518da7
Show file tree
Hide file tree
Showing 18 changed files with 1,225 additions and 1,023 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build --print-build-logs .
uses: SpiralP/github-reusable-workflows/.github/workflows/build.yml@main
26 changes: 5 additions & 21 deletions .github/workflows/update-lock-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,8 @@ permissions:
pull-requests: write

jobs:
update_lock_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix flake update
- run: git diff && git add -v .
- run: nix develop --print-build-logs . -c cargo update
- run: git diff && git add -v .
- run: nix develop --print-build-logs . -c npm update
- run: git diff && git add -v .
- run: nix run --no-write-lock-file --print-build-logs ./.github#update-nix-hashes -- default package-lock.json
- run: git diff && git add -v .
- run: nix build --print-build-logs .
- uses: peter-evans/create-pull-request@v6
with:
branch: update-lock-files
title: Update lock files
body: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
commit-message: "Update lock files"
update_nix_hashes:
uses: SpiralP/github-reusable-workflows/.github/workflows/update-lock-files.yml@main
with:
npm-attribute: default
rust-attribute: wasm
21 changes: 3 additions & 18 deletions .github/workflows/update-nix-hashes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,8 @@ concurrency:
permissions:
contents: write

env:
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com

jobs:
update_nix_hashes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix run --no-write-lock-file --print-build-logs ./.github#update-nix-hashes -- default package-lock.json
- run: git diff && git add -v .
- run: nix build --print-build-logs .
- run: "git commit -m 'nix: update hashes' || true"
- run: git push origin
uses: SpiralP/github-reusable-workflows/.github/workflows/update-nix-hashes.yml@main
with:
npm-attribute: default
104 changes: 51 additions & 53 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,49 @@
chatsounds-cli = chatsounds-cli-repo.outputs.packages.${system}.default;
in
rec {
default = pkgs.buildNpmPackage {
name = "chatsounds-web";

src = lib.sourceByRegex ./. [
"^\.gitignore$"
# need npmignore or else dist isn't copied
"^\.npmignore$"
"^package-lock\.json$"
"^package\.json$"
"^web(/.*)?$"
];

npmDepsHash = "sha256-x00zS9EngNOEKUm3PBA5B+9YJtQvd4JF5ivyohnX2Hc=";

preBuild = ''
ln -vsf ${wasm}/pkg ./node_modules/chatsounds-web
'';

postInstall = with pkgs; ''
wrapProgram $out/bin/chatsounds-web \
--prefix PATH : ${lib.makeBinPath [ chatsounds-cli ffmpeg ]}
'';

nativeBuildInputs = with pkgs;
if dev
then
(wasm.nativeBuildInputs ++ [
chatsounds-cli
clippy
ffmpeg
rust-analyzer
rustfmt
])
else [ ];

buildInputs =
if dev
then wasm.buildInputs
else [ ];

meta.mainProgram = "chatsounds-web";
};

wasm = pkgs.stdenv.mkDerivation {
pname = "chatsounds-web-wasm";
version = "0.0.1";
Expand Down Expand Up @@ -47,6 +90,14 @@
};
};

# fix "linker `rust-lld` not found"
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";

buildInputs = with pkgs; [
openssl
alsa-lib
];

nativeBuildInputs = with pkgs; [
wasm-pack
(
Expand All @@ -62,59 +113,6 @@
rustPlatform.bindgenHook
rustPlatform.cargoSetupHook
];
# fix "linker `rust-lld` not found"
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";

buildInputs = with pkgs; [
openssl
alsa-lib
];
};

default = pkgs.buildNpmPackage {
name = "chatsounds-web";

src = lib.sourceByRegex ./. [
"^\.gitignore$"
# need npmignore or else dist isn't copied
"^\.npmignore$"
"^package-lock\.json$"
"^package\.json$"
"^web(/.*)?$"
];

npmDepsHash = "sha256-wWt8iKjK5Dy1Vu4eQHpYVaNqccfHkKTM3KI9Ckdw270=";

preBuild = ''
ln -vsf ${wasm}/pkg ./node_modules/chatsounds-web
npm run typecheck
npm run lint
'';

postInstall = with pkgs; ''
wrapProgram $out/bin/chatsounds-web \
--prefix PATH : ${lib.makeBinPath [ chatsounds-cli ffmpeg ]}
'';

nativeBuildInputs = with pkgs;
if dev
then
(wasm.nativeBuildInputs ++ [
chatsounds-cli
clippy
ffmpeg
rust-analyzer
rustfmt
])
else [ ];

buildInputs =
if dev
then wasm.buildInputs
else [ ];

meta.mainProgram = "chatsounds-web";
};

docker = pkgs.dockerTools.streamLayeredImage {
Expand Down
Loading

0 comments on commit a518da7

Please sign in to comment.