Skip to content

Commit

Permalink
feat!: add shellcheck 0.10.0 (#12)
Browse files Browse the repository at this point in the history
Support for building older releases was dropped, but they are built and
published to GitHub releases already so it won't be needed anyway.
  • Loading branch information
felipecrs authored Mar 8, 2024
1 parent 30d9443 commit 7eed4cb
Show file tree
Hide file tree
Showing 11 changed files with 2,211 additions and 4,113 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup Node.js and NPM
uses: volta-cli/action@v4
- name: Install dependencies
run: npm install
- name: Check
run: npm run check
- name: ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error
ignore_paths: ./node_modules
scandir: ./scripts

release:
runs-on: ubuntu-latest
Expand All @@ -36,27 +38,21 @@ jobs:
strategy:
matrix:
include:
- version: '0.9.0'
homebrew-version: '0.9.0'
- version: '0.8.0'
homebrew-version: '0.8.0'
- version: '0.7.2'
homebrew-version: '0.7.2-1'
- version: '0.10.0'
fail-fast: false
steps:
- name: Set environment variables
run: |
echo "VERSION=${{ matrix.version }}" >> $GITHUB_ENV
echo "HOMEBREW_VERSION=${{ matrix.homebrew-version }}" >> $GITHUB_ENV
echo "TAG=v${{ matrix.version }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build packages
uses: docker/bake-action@v2
uses: docker/bake-action@v4
- name: Create GitHub release
if: github.event_name == 'push'
env:
Expand All @@ -71,7 +67,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set latest release
Expand Down
7 changes: 1 addition & 6 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
#!/usr/bin/env sh

# shellcheck source=./_/husky.sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- lint-staged
npx lint-staged
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{sh}": "prettier --write"
"*.sh": "prettier --write"
}
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "none",
"plugins": ["prettier-plugin-sh"]
}
9 changes: 0 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
# ================
# ShellCheck version
ARG VERSION
ARG HOMEBREW_VERSION

# ================
# DARWIN ARM64
# ================
FROM --platform=darwin/arm64 ghcr.io/homebrew/core/shellcheck:$HOMEBREW_VERSION AS darwin-arm64

# ================
# ARCHIVES
Expand All @@ -27,9 +21,6 @@ RUN apk add --no-cache \

ARG VERSION

# Copy Darwin arm64 binary
COPY --from=darwin-arm64 shellcheck/$VERSION/bin/shellcheck /shellcheck.darwin.arm64.data/

# Copy scripts directory
COPY scripts /scripts

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# ShellCheck binaries for the VS Code extension

ShellCheck binaries distributed in `.tar.gz` format for Linux and macOS, including M1 Macs. Used by [ShellCheck VS Code extension](https://github.com/vscode-shellcheck/vscode-shellcheck).
ShellCheck binaries distributed in `.tar.gz` format for Linux and macOS. Used by [ShellCheck VS Code extension](https://github.com/vscode-shellcheck/vscode-shellcheck).

## Why?

- ShellCheck doesn't officially provide binaries for M1 Macs.
- ShellCheck ships binaries packaged in `.tar.xz` format, in which [`bindl`](https://github.com/felipecrs/bindl/issues/217) doesn't support.
- ShellCheck ships binaries packaged in `.tar.xz` format, in which [`bindl`](https://github.com/felipecrs/bindl/issues/217) doesn't support by default.

## How to generate more binaries?

Expand All @@ -14,7 +13,7 @@ Simply push a new tag to this repository in the format `v*.*.*` matching the [Sh
Example:

```console
git push origin HEAD:refs/tags/v0.8.0 --force
git push origin HEAD:refs/tags/v0.10.0 --force
```

## Development
Expand Down
5 changes: 0 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
variable "VERSION" {}

variable "HOMEBREW_VERSION" {
default = "${VERSION}"
}

target "default" {
dockerfile = "Dockerfile"
args = {
VERSION = "${VERSION}"
HOMEBREW_VERSION = "${HOMEBREW_VERSION}"
}
output = ["./dist"]
}
Loading

0 comments on commit 7eed4cb

Please sign in to comment.