Skip to content

Commit

Permalink
Scaffold the repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp committed Jun 16, 2024
1 parent 32569e1 commit a1c86c7
Show file tree
Hide file tree
Showing 58 changed files with 5,047 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.jsonc]
indent_size = 2

[*.vsconfig]
indent_size = 2

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text
*.verified.* text eol=lf
*.ico binary
*.png binary
*.zig eol=lf
4 changes: 4 additions & 0 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root: doc
structure:
readme: index.md
summary: toc.md
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @vezel-dev/graf-maintainers
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
version: 2
updates:
- package-ecosystem: github-actions
directories:
- /
schedule:
interval: daily
timezone: Europe/Copenhagen
time: "12:00"
open-pull-requests-limit: 25
labels: []
- package-ecosystem: npm
directories:
- /doc
- /sup/vscode
schedule:
interval: daily
timezone: Europe/Copenhagen
time: "12:00"
open-pull-requests-limit: 25
labels: []
- package-ecosystem: nuget
directories:
- /
schedule:
interval: daily
timezone: Europe/Copenhagen
time: "12:00"
open-pull-requests-limit: 25
labels: []
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build
on:
push:
branches-ignore:
- dependabot/**
pull_request:
workflow_dispatch:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-12
- macos-13
- macos-14
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- windows-2019
- windows-2022
mode:
- Debug
- ReleaseFast
- ReleaseSafe
- ReleaseSmall
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
submodules: recursive
- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2.2.0
with:
version: 0.13.0
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2.9.0
- name: Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version-file: doc/package.json
- name: Check source code and documentation
run: |
zig build check --summary all
- name: Build VS Code extension
run: |
zig build vscode --summary all
# Keep the target list in sync with release.yml.
- name: Build binary artifacts
run: |
linuxver=4.19.0
glibcver=2.17.0
macosver=11.7.0
windowsver=win8_1
for target in aarch64-linux.$linuxver-gnu.$glibcver \
aarch64-linux.$linuxver-musl \
arm-linux.$linuxver-gnueabi.$glibcver \
arm-linux.$linuxver-gnueabihf.$glibcver \
arm-linux.$linuxver-musleabi \
arm-linux.$linuxver-musleabihf \
mips-linux.$linuxver-gnueabi.$glibcver \
mips-linux.$linuxver-gnueabihf.$glibcver \
mips-linux.$linuxver-musl \
mips64-linux.$linuxver-gnuabi64.$glibcver \
mips64-linux.$linuxver-musl \
mips64el-linux.$linuxver-gnuabi64.$glibcver \
mips64el-linux.$linuxver-musl \
mipsel-linux.$linuxver-gnueabi.$glibcver \
mipsel-linux.$linuxver-gnueabihf.$glibcver \
mipsel-linux.$linuxver-musl \
powerpc-linux.$linuxver-gnueabi.$glibcver \
powerpc-linux.$linuxver-gnueabihf.$glibcver \
powerpc-linux.$linuxver-musl \
powerpc64-linux.$linuxver-gnu.$glibcver \
powerpc64-linux.$linuxver-musl \
powerpc64le-linux.$linuxver-gnu.$glibcver \
powerpc64le-linux.$linuxver-musl \
riscv64-linux.$linuxver-gnu.$glibcver \
riscv64-linux.$linuxver-musl \
x86-linux.$linuxver-gnu.$glibcver \
x86-linux.$linuxver-musl \
x86_64-linux.$linuxver-gnu.$glibcver \
x86_64-linux.$linuxver-musl \
aarch64-macos.$macosver-none \
x86_64-macos.$macosver-none \
aarch64-windows.$windowsver-gnu \
x86_64-windows.$windowsver-gnu; do
zig build --summary all -Dtarget=$target -Doptimize=${{ matrix.mode }}
done
- name: Build and run tests
run: |
zig build test --summary all -Doptimize=${{ matrix.mode }}
106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Release
on:
release:
types:
- published
permissions:
attestations: write
contents: write
id-token: write
defaults:
run:
shell: bash
jobs:
release:
if: github.repository == 'vezel-dev/graf'
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
submodules: recursive
- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2.2.0
with:
version: 0.13.0
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2.9.0
- name: Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version-file: doc/package.json
- name: Extract build version
id: version
run: |
echo version=$(sed '/^\s*\.version\s*=\s*"\([^"]*\)"\{0,1\},$/ {s//\1/p; q}' build.zig.zon -n) >> $GITHUB_OUTPUT
# Keep the target list in sync with build.yml.
- name: Build and package binary artifacts
run: |
mkdir artifacts
linuxver=4.19.0
glibcver=2.17.0
macosver=11.7.0
windowsver=win8_1
for target in aarch64-linux.$linuxver-gnu.$glibcver \
aarch64-linux.$linuxver-musl \
arm-linux.$linuxver-gnueabi.$glibcver \
arm-linux.$linuxver-gnueabihf.$glibcver \
arm-linux.$linuxver-musleabi \
arm-linux.$linuxver-musleabihf \
mips-linux.$linuxver-gnueabi.$glibcver \
mips-linux.$linuxver-gnueabihf.$glibcver \
mips-linux.$linuxver-musl \
mips64-linux.$linuxver-gnuabi64.$glibcver \
mips64-linux.$linuxver-musl \
mips64el-linux.$linuxver-gnuabi64.$glibcver \
mips64el-linux.$linuxver-musl \
mipsel-linux.$linuxver-gnueabi.$glibcver \
mipsel-linux.$linuxver-gnueabihf.$glibcver \
mipsel-linux.$linuxver-musl \
powerpc-linux.$linuxver-gnueabi.$glibcver \
powerpc-linux.$linuxver-gnueabihf.$glibcver \
powerpc-linux.$linuxver-musl \
powerpc64-linux.$linuxver-gnu.$glibcver \
powerpc64-linux.$linuxver-musl \
powerpc64le-linux.$linuxver-gnu.$glibcver \
powerpc64le-linux.$linuxver-musl \
riscv64-linux.$linuxver-gnu.$glibcver \
riscv64-linux.$linuxver-musl \
x86-linux.$linuxver-gnu.$glibcver \
x86-linux.$linuxver-musl \
x86_64-linux.$linuxver-gnu.$glibcver \
x86_64-linux.$linuxver-musl \
aarch64-macos.$macosver-none \
x86_64-macos.$macosver-none \
aarch64-windows.$windowsver-gnu \
x86_64-windows.$windowsver-gnu; do
zig build --summary all -Dtarget=$target -Doptimize=ReleaseFast
pushd zig-out
zip ../artifacts/Graf.${{ steps.version.outputs.version }}.$target.zip . -r -9
popd
done
- name: Build VS Code extension
run: |
zig build vscode --summary all
- name: Attest binary artifacts
uses: actions/attest-build-provenance@v1.1.2
with:
subject-path: artifacts/*.zip
- name: Attest VS Code extension
uses: actions/attest-build-provenance@v1.1.2
with:
subject-path: vscode/*.vsix
- name: Upload binary artifacts
run: |
gh release upload ${{ github.event.release.tag_name }} artifacts/*.zip --clobber
# TODO: Remove --pre-release flag (and preview property in package.json).
- name: Upload VS Code extension
working-directory: sup/vscode
run: |
npx vsce publish --pre-release --skip-duplicate -p ${{ secrets.VSCE_TOKEN }} -i ../../vscode/*.vsix
npx ovsx publish --pre-release --skip-duplicate -p ${{ secrets.OVSX_TOKEN }} -i ../../vscode/*.vsix
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.zig-cache
/vscode
/zig-out
node_modules
95 changes: 95 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
"default": true,
"MD001": true,
"MD003": {
"style": "atx"
},
"MD004": {
"style": "asterisk"
},
"MD005": true,
"MD007": {
"start_indented": false,
"start_indent": 4,
"indent": 4
},
"MD009": {
"br_spaces": 0,
"strict": true
},
"MD010": {
"spaces_per_tab": 4
},
"MD011": true,
"MD012": true,
"MD013": {
"code_blocks": false,
"headings": false,
"tables": false
},
"MD014": true,
"MD018": true,
"MD019": true,
"MD020": true,
"MD021": true,
"MD022": true,
"MD023": true,
"MD024": true,
"MD025": true,
"MD026": {
"punctuation": "!,.:;?"
},
"MD027": true,
"MD028": true,
"MD029": {
"style": "ordered"
},
"MD030": true,
"MD031": true,
"MD032": true,
"MD033": {
"allowed_elements": [
"div",
"img",
"p",
"strong"
]
},
"MD034": true,
"MD035": {
"style": "--------------------------------------------------------------------------------"
},
"MD036": {
"punctuation": "!,.:;?"
},
"MD037": true,
"MD038": true,
"MD039": true,
"MD040": {
"language_only": true
},
"MD041": true,
"MD042": true,
"MD043": false,
"MD044": true,
"MD045": true,
"MD046": {
"style": "fenced"
},
"MD047": true,
"MD048": {
"style": "backtick"
},
"MD049": {
"style": "asterisk"
},
"MD050": {
"style": "asterisk"
},
"MD051": true,
"MD052": true,
"MD053": {
"ignored_definitions": []
}
}
Loading

0 comments on commit a1c86c7

Please sign in to comment.