Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
schedule:
- cron: "0 6 * * 1" # Every monday 6 AM

permissions: {}

jobs:
test:
strategy:
Expand All @@ -29,7 +31,7 @@ jobs:
git config --global core.autocrlf false

- name: Install Crystal
uses: oprypin/install-crystal@v1
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}

Expand All @@ -51,6 +53,8 @@ jobs:

- name: Download source
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Build
run: make -f ${{ runner.os == 'Windows' && 'Makefile.win' || 'Makefile' }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ jobs:
steps:
- name: Download source
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Build manpages
uses: Analog-inc/asciidoctor-action@v1.3.2
uses: Analog-inc/asciidoctor-action@328aa83fd20efb2e8899a34716db60c9ddf2d9a0 # v1.3.2
with:
shellcommand: "make -B manpages SOURCE_DATE_EPOCH=\"$(date +%s --utc --date \"$(grep -m1 -o -E 'Date: .*' man/shard.yml.5 | cut -d' ' -f2)\")\""
- name: Ensure no changes
run: git diff --exit-code || echo '`make manpages` produced changes. Please rebuild the docs.'
run: git diff --exit-code || echo "\`make manpages\` produced changes. Please rebuild the docs."
6 changes: 6 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rules:
unpinned-uses:
config:
policies:
actions/*: ref-pin
crystal-lang/*: ref-pin
37 changes: 37 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
default: true

heading-style: "setext"

no-inline-html: false
line-length: false

ol-prefix:
style: "ordered"
ul-style:
style: "dash"
ul-indent:
indent: 2

no-blanks-blockquote: false

emphasis-style:
style: "underscore"
strong-style:
style: "asterisk"

no-duplicate-heading:
siblings_only: true
no-bare-urls: false

fenced-code-language: false
commands-show-output: false

first-line-h1:
front_matter_title: "^\\s*(page_)?title\\s*[:=]"
exclude:
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

no-alt-text: false

hard_tab:
code_blocks: false
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lib/
25 changes: 15 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

### Infrastructure

* Changelog for 0.19.1 ([#666], thanks @straight-shoota)
- Changelog for 0.19.1 ([#666], thanks @straight-shoota)

[#666]: https://github.com/crystal-lang/shards/pull/666

Expand Down Expand Up @@ -194,10 +194,10 @@

### Infrastructure

- *(ci)* Ensure manpages are generated with no diff ([#594](https://github.com/crystal-lang/shards/pull/594), thanks @straight-shoota)
- *(ci)* Upgrade xcode version on circleci ([#603](https://github.com/crystal-lang/shards/pull/603), thanks @straight-shoota)
- *(ci)* Pin GHA runner versions ([#604](https://github.com/crystal-lang/shards/pull/604), thanks @straight-shoota)
- *(ci)* Pin `Analog-inc/asciidoctor-action` version ([#602](https://github.com/crystal-lang/shards/pull/602), thanks @straight-shoota)
- _(ci)_ Ensure manpages are generated with no diff ([#594](https://github.com/crystal-lang/shards/pull/594), thanks @straight-shoota)
- _(ci)_ Upgrade xcode version on circleci ([#603](https://github.com/crystal-lang/shards/pull/603), thanks @straight-shoota)
- _(ci)_ Pin GHA runner versions ([#604](https://github.com/crystal-lang/shards/pull/604), thanks @straight-shoota)
- _(ci)_ Pin `Analog-inc/asciidoctor-action` version ([#602](https://github.com/crystal-lang/shards/pull/602), thanks @straight-shoota)

## [0.17.3] (2023-04-07)

Expand Down Expand Up @@ -279,7 +279,7 @@

- Escape automatic ligatures in AsciiDoc ([#489](https://github.com/crystal-lang/shards/pull/489), thanks @elebow)
- Fix links in README ([#500](https://github.com/crystal-lang/shards/pull/500), [#483](https://github.com/crystal-lang/shards/pull/483), thanks @szabgab, @kimburgess)
- Correct list identation in shard.yml.adoc ([#492](https://github.com/crystal-lang/shards/pull/492/files), thanks @elebow)
- Correct list indentation in shard.yml.adoc ([#492](https://github.com/crystal-lang/shards/pull/492/files), thanks @elebow)
- Add getting started section to README ([#513](https://github.com/crystal-lang/shards/pull/513), thanks @straight-shoota)

## [0.14.1] (2021-03-10)
Expand Down Expand Up @@ -381,7 +381,7 @@

### Features

- **(breaking-change)** Use `crystal:` property to filter candidates version. ([#395](https://github.com/crystal-lang/shards/pull/395), thanks @waj, @bcardiff)
- **(breaking-change)** Use `crystal:` property to filter candidates version. ([#395](https://github.com/crystal-lang/shards/pull/395), thanks @waj, @bcardiff)
- Introduce `shard.lock` 2.0 format, run `shards install` to migrate. ([#349](https://github.com/crystal-lang/shards/pull/349), [#400](https://github.com/crystal-lang/shards/pull/400), thanks @waj)
- Support intersection in requirements `version: >= 1.0.0, < 2.0`. ([#394](https://github.com/crystal-lang/shards/pull/394), thanks @waj)
- Install dependencies in reverse topological order. ([#369](https://github.com/crystal-lang/shards/pull/369), thanks @waj)
Expand Down Expand Up @@ -458,6 +458,7 @@
[0.9.0.rc1]: https://github.com/crystal-lang/shards/releases/0.9.0.rc1

Breaking changes:

- Dependency solver was overhauled;
- Git tag refs that match a version number are now an actual version (i.e.
`tag: v1.0.0` is converted to `version: 1.0.0`).
Expand All @@ -468,10 +469,10 @@ Breaking changes:
version if possible;
- Add `--local` argument to use the cache as-is, allowing to skip git fetches
when you know the cache is up-to-date;
- Add the *outdated* command to list dependencies that could be updated
- Add the _outdated_ command to list dependencies that could be updated
(matching constraints) as well as their latest version; including pre-release
versions on demand.
- Add the *lock* command that behaves like the *install* and *update* commands
- Add the _lock_ command that behaves like the _install_ and _update_ commands
but that only creates a lockfile, and doesn't install anything.

### Fixes
Expand All @@ -485,6 +486,7 @@ Breaking changes:
[0.9.0.beta]: https://github.com/crystal-lang/shards/releases/0.9.0.beta

Breaking changes:

- A `shard.yml` spec is now required in libraries.
- Drop support for obsolete Projectfile.

Expand Down Expand Up @@ -575,6 +577,7 @@ Breaking changes:
- Shorthand for gitlab.com dependencies

Breaking Changes:

- Dependencies are installed in the `lib` directory
- Dependencies are now fully installed, instead of merely the `src` folder
- `postinstall` scripts are now executed from the root of the dependency,
Expand Down Expand Up @@ -674,6 +677,7 @@ Breaking Changes:
[0.5.0]: https://github.com/crystal-lang/shards/releases/0.5.0

Breaking Change:

- renamed `--no-colors` option as `--no-color` to match crystal

### Features
Expand Down Expand Up @@ -701,11 +705,12 @@ Breaking Change:

### Features

- lock resolved versions for indempotent installs across computers, see #27
- lock resolved versions for idempotent installs across computers, see #27
- `--production` parameter to skip development dependencies
- postintall hook to run a command after installing a dependency, see #19

Breaking Changes:

- dropped support for custom dependency groups (but kept `development_dependencies`), see #27

### Fixes
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ prefixed with a `v`. Examples: `v1.2.3`, `v2.0.0-rc1` or `v2017.04.1`.
Please see the [SPEC](docs/shard.yml.adoc) for more details about the
`shard.yml` format.


## Install

Shards is usually distributed with Crystal itself (e.g. Homebrew and Debian
Expand Down Expand Up @@ -62,12 +61,12 @@ Happy Hacking!

These requirements are only necessary for compiling Shards.

* Crystal
- Crystal

Please refer to <https://crystal-lang.org/install/> for
instructions for your operating system.

* libyaml
- libyaml

On Debian/Ubuntu Linux you may install the `libyaml-dev` package.

Expand All @@ -76,7 +75,7 @@ These requirements are only necessary for compiling Shards.
variable (eg: `export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"`).
Please adjust the path per your Homebrew installation.

* [asciidoctor](https://asciidoctor.org/)
- [asciidoctor](https://asciidoctor.org/)

Needed for building manpages.

Expand All @@ -86,15 +85,17 @@ It is strongly recommended to use `make` for building shards and developing it.
The [`Makefile`](./Makefile) contains recipes for compiling and testing.

Run `make bin/shards` to build the binary.
* `release=1` for a release build (applies optimizations)
* `static=1` for static linking (only works with musl-libc)
* `debug=1` for full symbolic debug info

- `release=1` for a release build (applies optimizations)
- `static=1` for static linking (only works with musl-libc)
- `debug=1` for full symbolic debug info

Run `make install` to install the binary. Target path can be adjusted with `PREFIX` (default: `PREFIX=/usr/bin`).

Run `make test` to run the test suites:
* `make test_unit` runs unit tests (`./spec/unit`)
* `make test_integration` runs integration tests (`./spec/integration`) on `bin/shards`

- `make test_unit` runs unit tests (`./spec/unit`)
- `make test_integration` runs integration tests (`./spec/integration`) on `bin/shards`

Run `make docs` to build the manpages.

Expand Down
2 changes: 2 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# `shard.yml` specification

The documentation for `shard.yml` has moved to [`docs/shard.yml.adoc`](docs/shard.yml.adoc).
6 changes: 6 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = [
".git/**",
"lib/**",
"man/**",
]
23 changes: 22 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ pkgs, lib, config, inputs, ... }:

{
dotenv.enable = true;

packages = with pkgs; [
# build deps
gnumake
Expand All @@ -20,7 +22,26 @@
};

git-hooks.hooks = {
shellcheck.enable = true;
actionlint.enable = true;
check-toml.enable = true;
check-vcs-permalinks.enable = true;
circleci.enable = true;
crystal.enable = true;
makefile_both = {
enable = true;
name = "Change both Makefile and Makefile.win";
entry = ''${pkgs.runtimeShell} -c 'test "$#" -ne 1 || (echo "Changes only in $@" && false)' --'';
files = "^Makefile(\.win)?$";
pass_filenames = true;
};
markdownlint.enable = true;
shellcheck = {
enable = true;
excludes = [
".*\.zsh$"
];
};
typos.enable = true;
zizmor.enable = true;
};
}
2 changes: 1 addition & 1 deletion spec/unit/spec_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ module Shards
end

it "raises on unknown attributes if validating" do
expect_raises(ParseError, "unknown attribute: anme") { Spec.from_yaml("anme:", validate: true) }
expect_raises(ParseError, "unknown attribute: mane") { Spec.from_yaml("mane:", validate: true) }
end

it "raises when required attributes are missing" do
Expand Down