init
This commit is contained in:
46
.github/README.md
vendored
Normal file
46
.github/README.md
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# zig template
|
||||
|
||||
[](https://github.com/spotdemo4/zig-template/actions/workflows/check.yaml)
|
||||
[](https://github.com/spotdemo4/zig-template/actions/workflows/vulnerable.yaml)
|
||||
[](https://nixos.org/)
|
||||
[%22&replace=%241&logo=zig&logoColor=%23bac2de&label=zig&labelColor=%23313244&color=%23F7A41D>)](https://ziglang.org/)
|
||||
|
||||
template for [zig](https://ziglang.org/)
|
||||
|
||||
part of [spotdemo4/templates](https://github.com/spotdemo4/templates)
|
||||
|
||||
## requirements
|
||||
|
||||
- [nix](https://nixos.org/)
|
||||
- [direnv](https://direnv.net/) (optional)
|
||||
|
||||
## getting started
|
||||
|
||||
initialize direnv:
|
||||
|
||||
```elm
|
||||
ln -s .envrc.project .envrc &&
|
||||
direnv allow
|
||||
```
|
||||
|
||||
or manually enter the development environment:
|
||||
|
||||
```elm
|
||||
nix develop
|
||||
```
|
||||
|
||||
### check
|
||||
|
||||
```elm
|
||||
nix flake check
|
||||
```
|
||||
|
||||
### release
|
||||
|
||||
releases are automatically created for [significant](https://www.conventionalcommits.org/en/v1.0.0/#summary) changes
|
||||
|
||||
to manually create a version bump:
|
||||
|
||||
```elm
|
||||
bumper
|
||||
```
|
||||
34
.github/renovate.json
vendored
Normal file
34
.github/renovate.json
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-global-schema.json",
|
||||
|
||||
// self-hosted
|
||||
"onboarding": false,
|
||||
"requireConfig": "ignored",
|
||||
"platform": "github",
|
||||
"repositories": ["spotdemo4/zig-template"],
|
||||
|
||||
// repository
|
||||
"extends": ["config:recommended"],
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true,
|
||||
"automerge": true,
|
||||
"schedule": ["* * * * 0"] // sunday
|
||||
},
|
||||
"nix": {
|
||||
"enabled": true
|
||||
},
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"matchManagers": ["nix"],
|
||||
"groupName": "nix inputs"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["github-actions"],
|
||||
"groupName": "github actions"
|
||||
}
|
||||
]
|
||||
}
|
||||
39
.github/workflows/bump.yaml
vendored
Normal file
39
.github/workflows/bump.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: bump
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 22 * * 1-5" # every weekday at 22:00 UTC
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force:
|
||||
description: "force"
|
||||
required: false
|
||||
type: choice
|
||||
default: "true"
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
|
||||
concurrency:
|
||||
group: release
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
with:
|
||||
app_id: ${{ vars.CLIENT_ID }}
|
||||
app_key: ${{ secrets.PRIVATE_KEY }}
|
||||
fetch_depth: 0
|
||||
shell: bump
|
||||
|
||||
- name: Bump
|
||||
run: bumper
|
||||
env:
|
||||
FORCE: ${{ inputs.force }}
|
||||
25
.github/workflows/check.yaml
vendored
Normal file
25
.github/workflows/check.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
push:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
|
||||
- name: Check
|
||||
run: nix flake check
|
||||
35
.github/workflows/release.yaml
vendored
Normal file
35
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: release
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
with:
|
||||
app_id: ${{ vars.CLIENT_ID }}
|
||||
app_key: ${{ secrets.PRIVATE_KEY }}
|
||||
fetch_depth: 0
|
||||
shell: release
|
||||
|
||||
- name: Release
|
||||
run: flake-release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.checkout.outputs.token }}
|
||||
REGISTRY: ghcr.io
|
||||
REGISTRY_USERNAME: ${{ github.actor }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
29
.github/workflows/update.yaml
vendored
Normal file
29
.github/workflows/update.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: update
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 9 * * *" # every day at 09:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
with:
|
||||
app_id: ${{ vars.CLIENT_ID }}
|
||||
app_key: ${{ secrets.PRIVATE_KEY }}
|
||||
shell: update
|
||||
|
||||
- name: Renovate
|
||||
run: renovate
|
||||
env:
|
||||
RENOVATE_CONFIG_FILE: .github/renovate.json
|
||||
RENOVATE_TOKEN: ${{ steps.checkout.outputs.token }}
|
||||
LOG_LEVEL: ${{ runner.debug == '1' && 'debug' || 'info' }}
|
||||
33
.github/workflows/vulnerable.yaml
vendored
Normal file
33
.github/workflows/vulnerable.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: vulnerable
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 9 * * 0" # every Sunday at 09:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
flake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
with:
|
||||
shell: vulnerable
|
||||
|
||||
- name: Run flake-checker
|
||||
run: flake-checker -f
|
||||
|
||||
actions:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: spotdemo4/nix-init@5fe5a93e1ff2a6a4cfba1ae7d3f30d0dfed9d1a9 # v1.34.1
|
||||
with:
|
||||
shell: vulnerable
|
||||
|
||||
- name: Run octoscan
|
||||
run: find .github/workflows -exec octoscan scan {} \;
|
||||
Reference in New Issue
Block a user