Skip to content

Commit

Permalink
Fetched template changes (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras authored Mar 10, 2024
1 parent f0c55c3 commit ad37aea
Show file tree
Hide file tree
Showing 21 changed files with 1,417 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 0.7.3
_commit: 0.9.0
_src_path: gh:radio-aktywne/template-meta
accountname: radio-aktywne
description: React app template ⚛️
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ jobs:
origin
${{ github.event.pull_request.base.ref }}
- name: Setup Nix cache
uses: actions/cache@v3.3.2
uses: actions/cache@v4.0.1
id: cache-nix
with:
path: ${{ env.NIX_CACHE_DIR }}
key: lint-nix
- name: Setup Trunk cache
uses: actions/cache@v3.3.2
uses: actions/cache@v4.0.1
with:
path: ${{ env.TRUNK_CACHE_DIR }}
key: lint-trunk
- name: Install Nix
uses: cachix/install-nix-action@v24
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ github.token }}
install_url: https://releases.nixos.org/nix/nix-2.19.2/install
install_url: https://releases.nixos.org/nix/nix-2.20.5/install
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Import Nix store cache
if: steps.cache-nix.outputs.cache-hit == 'true'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ jobs:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Nix cache
uses: actions/cache@v3.3.2
uses: actions/cache@v4.0.1
id: cache-nix
with:
path: ${{ env.NIX_CACHE_DIR }}
key: test-nix
- name: Setup Trunk cache
uses: actions/cache@v3.3.2
uses: actions/cache@v4.0.1
with:
path: ${{ env.TRUNK_CACHE_DIR }}
key: test-trunk
- name: Install Nix
uses: cachix/install-nix-action@v24
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ github.token }}
install_url: https://releases.nixos.org/nix/nix-2.19.2/install
install_url: https://releases.nixos.org/nix/nix-2.20.5/install
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Import Nix store cache
if: steps.cache-nix.outputs.cache-hit == 'true'
Expand Down
28 changes: 14 additions & 14 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: 0.1
cli:
version: 1.18.0
version: 1.20.1
plugins:
sources:
- id: trunk
ref: v1.4.0
ref: v1.4.4
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
# Needed for gitleaks, shfmt
- go@1.21.5
- go@1.22.1
# Needed for markdownlint, prettier, svgo
- node@20.9.0
- node@21.7.1
# Needed for black, ruff, yamllint
- [email protected].1
- [email protected].6
lint:
ignore:
- linters: [ALL]
Expand Down Expand Up @@ -59,32 +59,32 @@ lint:
success_codes: [0, 1]
enabled:
# GitHub Actions linting
- [email protected].26
- [email protected].27
# Python formatting
- black@23.11.0
- black@24.2.0
# Check for whitespace errors
- git-diff-check
# Check for secrets in the code
- [email protected].1
- [email protected].2
# Dockerfile linting
- [email protected]
# Markdown linting
- markdownlint@0.37.0
- markdownlint@0.39.0
# Nix formatting check
- nix-fmt-check@SYSTEM
# Nix flake check
- nix-flake-check@SYSTEM
# JS, JSON, YAML, Markdown formatting
- [email protected]
# Python linting
- ruff@0.1.7
- ruff@0.3.2
# Shell linting
- shellcheck@0.9.0
- shellcheck@0.10.0
# Shell formatting
- shfmt@3.7.0
- shfmt@3.8.0
# SVG formatting
- svgo@3.0.5
- svgo@3.2.0
# TOML formatting
- [email protected]
# YAML linting
- yamllint@1.33.0
- yamllint@1.35.1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT No Attribution

Copyright (c) 2023 radio-aktywne
Copyright (c) 2024 radio-aktywne

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
Expand Down
12 changes: 7 additions & 5 deletions Taskfile.dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ tasks:
build/
shallow-build:
desc: Build the project without initializing git
internal: true
env:
GIT_CONFIG_GLOBAL: ""
GIT_CONFIG_SYSTEM: ""
Expand Down Expand Up @@ -86,10 +85,6 @@ tasks:
--defaults
--vcs-ref
HEAD
--data
'appname=foo'
--data
'description=Example app'
{{ .CLI_ARGS }}
./
build/
Expand Down Expand Up @@ -144,6 +139,13 @@ tasks:
desc: Build the project
cmds:
- task: shallow-build
vars:
CLI_ARGS: >-
--data
'appname=foo'
--data
'description=Example app'
{{ .CLI_ARGS }}
- task: init-build
- task: add-build-changes
test:
Expand Down
20 changes: 10 additions & 10 deletions flake.lock

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

8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

flake-parts = {
Expand Down Expand Up @@ -35,7 +35,7 @@
system,
...
}: let
pytest = pkgs.python3.withPackages (ps: [ps.pytest ps.plumbum]);
python = pkgs.python311.withPackages (ps: [ps.pytest ps.plumbum]);
nil = pkgs.nil;
task = pkgs.go-task;
coreutils = pkgs.coreutils;
Expand Down Expand Up @@ -64,7 +64,7 @@
name = "dev";

packages = [
pytest
python
nil
task
coreutils
Expand Down Expand Up @@ -109,7 +109,7 @@
name = "test";

packages = [
pytest
python
task
coreutils
copier
Expand Down
11 changes: 7 additions & 4 deletions src/Dockerfile.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use generic base image with Nix installed
FROM nixos/nix:2.19.2 AS base-env
FROM nixos/nix:2.20.5 AS base-env

# Configure Nix
RUN echo "extra-experimental-features = nix-command flakes" >> /etc/nix/nix.conf
Expand Down Expand Up @@ -48,7 +48,7 @@ WORKDIR /build/

# Setup entrypoint for RUN commands
COPY scripts/shell.sh scripts/shell.sh
SHELL ["./scripts/shell.sh"]
SHELL ["/build/scripts/shell.sh"]

# Copy package files
COPY package.json package-lock.json ./
Expand Down Expand Up @@ -82,12 +82,15 @@ RUN useradd --create-home app

# Setup entrypoint for RUN commands
COPY scripts/shell.sh scripts/shell.sh
SHELL ["./scripts/shell.sh"]
SHELL ["/app/scripts/shell.sh"]

# Copy static files from build
COPY --from=build /build/build/ build/

# Setup main entrypoint
COPY scripts/entrypoint.sh scripts/entrypoint.sh
ENTRYPOINT ["./scripts/entrypoint.sh", "caddy", "file-server", "--root", "build/", "--listen", ":{{ port }}", "--access-log"]
ENTRYPOINT ["/app/scripts/entrypoint.sh", "caddy", "file-server", "--root", "build/", "--listen", ":{{ port }}", "--access-log"]
CMD []

# Setup ownership
RUN chown -R app: /app/
2 changes: 1 addition & 1 deletion src/LICENSE.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT No Attribution

Copyright (c) 2023 {{ accountname }}
Copyright (c) 2024 {{ accountname }}

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
Expand Down
20 changes: 10 additions & 10 deletions src/flake.lock

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

Loading

0 comments on commit ad37aea

Please sign in to comment.