Skip to content

Commit 8782001

Browse files
author
Ryan Ameri
committed
implemented minimal linting and CICD pipelines
1 parent 32f12a9 commit 8782001

File tree

4 files changed

+266
-50
lines changed

4 files changed

+266
-50
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-License-Identifier: NCSA
2+
# Copyright (c) 2023-2026 Aryan Ameri
3+
#
4+
# =============================================================================
5+
# CI Workflow
6+
# Linting and formatting checks for shell and PowerShell scripts
7+
# =============================================================================
8+
9+
name: CI
10+
11+
on:
12+
push:
13+
branches: [main]
14+
pull_request:
15+
branches: [main]
16+
17+
env:
18+
SHFMT_VERSION: "3.12.0"
19+
SHELLCHECK_VERSION: "0.11.0"
20+
21+
jobs:
22+
lint:
23+
name: Lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Install shfmt
30+
run: |
31+
curl -fsSL "https://github.com/mvdan/sh/releases/download/v${SHFMT_VERSION}/shfmt_v${SHFMT_VERSION}_linux_amd64" -o shfmt
32+
chmod +x shfmt
33+
sudo mv shfmt /usr/local/bin/
34+
shfmt --version
35+
36+
- name: Install shellcheck
37+
run: |
38+
curl -fsSL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJf -
39+
sudo mv "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/local/bin/
40+
shellcheck --version
41+
42+
- name: Check shell script formatting (shfmt - Google style)
43+
run: |
44+
shfmt -d -i 2 -ci -bn *.sh
45+
46+
- name: Lint shell scripts (shellcheck - strictest)
47+
run: |
48+
shellcheck -o all -S style *.sh
49+
50+
- name: Lint PowerShell scripts (PSScriptAnalyzer - strictest)
51+
shell: pwsh
52+
run: |
53+
$results = Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Severity Error,Warning,Information
54+
if ($results) {
55+
$results | Format-Table -AutoSize
56+
exit 1
57+
}
58+
Write-Host "PowerShell lint passed"

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: NCSA
2+
# Copyright (c) 2023-2026 Aryan Ameri
3+
#
4+
# =============================================================================
5+
# Release Workflow
6+
# Creates GitHub release with zip archive on tag push
7+
# =============================================================================
8+
9+
name: Release
10+
11+
on:
12+
push:
13+
tags:
14+
- "v*"
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
release:
21+
name: Create Release
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Create release archive
28+
run: |
29+
VERSION="${GITHUB_REF_NAME#v}"
30+
ARCHIVE_NAME="devcontainer-on-windows-${VERSION}"
31+
mkdir -p "${ARCHIVE_NAME}"
32+
33+
# Copy all distributable files
34+
cp *.sh "${ARCHIVE_NAME}/"
35+
cp *.ps1 "${ARCHIVE_NAME}/"
36+
cp *.bat "${ARCHIVE_NAME}/"
37+
cp *.zsh "${ARCHIVE_NAME}/"
38+
cp *.txt "${ARCHIVE_NAME}/"
39+
cp *.ttf "${ARCHIVE_NAME}/"
40+
cp LICENSE "${ARCHIVE_NAME}/"
41+
cp README.md "${ARCHIVE_NAME}/"
42+
43+
# Create zip archive
44+
zip -r "${ARCHIVE_NAME}.zip" "${ARCHIVE_NAME}"
45+
46+
echo "ARCHIVE_NAME=${ARCHIVE_NAME}" >> $GITHUB_ENV
47+
48+
- name: Generate checksum
49+
run: |
50+
sha256sum "${{ env.ARCHIVE_NAME }}.zip" > SHA256SUMS
51+
52+
- name: Create GitHub Release
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: |
56+
${{ env.ARCHIVE_NAME }}.zip
57+
SHA256SUMS
58+
generate_release_notes: true
59+
draft: false
60+
prerelease: ${{ contains(github.ref_name, '-') }}
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)