Skip to content
Open
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
23 changes: 14 additions & 9 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@ on:
push:
tags: '*'

permissions:
contents: read

jobs:
build-lin:
name: Linux Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++-10-multilib
- uses: mlugg/setup-zig@v2
- name: Build
env:
RELEASE_BUILD: 1
DEMO_SIGN_PUBKEY: ${{ secrets.SAR_DEMO_SIGN_PUBKEY }}
DEMO_SIGN_PRIVKEY: ${{ secrets.SAR_DEMO_SIGN_PRIVKEY }}
run: make -j$(nproc)
run: zig build --summary all -Doptimize=ReleaseFast -Ddemo-sign-pubkey="$DEMO_SIGN_PUBKEY" -Ddemo-sign-privkey="$DEMO_SIGN_PRIVKEY" -Dcanary=false
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: sar-linux
path: sar.so
path: zig-out/lib/sar.so
if-no-files-found: error
- name: Upload to dl.sar.portal2.sr
if: github.repository_owner == 'p2sr'
Expand All @@ -43,12 +44,14 @@ jobs:
-F "commit=$GITHUB_SHA" \
-F "branch=$GITHUB_REF_NAME" \
-F "count=1" \
-F "hashes[0]=$(sha256sum sar.so | cut -d ' ' -f 1)" \
-F "files[0][email protected]" \
-F "hashes[0]=$(sha256sum zig-out/lib/sar.so | cut -d ' ' -f 1)" \
-F "files[0]=@zig-out/lib/sar.so" \
"https://dl.sar.portal2.jonesy.moe/api/v1/upload"
build-win:
name: Windows Build
runs-on: windows-2019
permissions:
contents: write
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
Expand Down Expand Up @@ -101,6 +104,8 @@ jobs:
if: github.repository == 'p2sr/SourceAutoRecord'
needs: [build-lin, build-win]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get Release Version
id: get_release
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,30 @@ on:
- 'Makefile'
workflow_dispatch:

permissions:
contents: read

jobs:
build-lin:
name: Linux Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++-10-multilib
- uses: mlugg/setup-zig@v2
- name: Build
env:
DEMO_SIGN_PUBKEY: ${{ secrets.SAR_DEMO_SIGN_PUBKEY }}
DEMO_SIGN_PRIVKEY: ${{ secrets.SAR_DEMO_SIGN_PRIVKEY }}
run: make -j$(nproc)
run: zig build --summary all -Doptimize=Debug -Ddemo-sign-pubkey="$DEMO_SIGN_PUBKEY" -Ddemo-sign-privkey="$DEMO_SIGN_PRIVKEY" -Dcanary=true
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: sar-linux
path: sar.so
path: zig-out/lib/sar.so
if-no-files-found: error
- name: Upload to dl.sar.portal2.sr
if: github.ref == 'refs/heads/master' && github.repository_owner == 'p2sr'
Expand All @@ -54,13 +56,15 @@ jobs:
-F "commit=$GITHUB_SHA" \
-F "branch=$GITHUB_REF_NAME" \
-F "count=1" \
-F "hashes[0]=$(sha256sum sar.so | cut -d ' ' -f 1)" \
-F "files[0][email protected]" \
-F "hashes[0]=$(sha256sum zig-out/lib/sar.so | cut -d ' ' -f 1)" \
-F "files[0]=@zig-out/lib/sar.so" \
"https://dl.sar.portal2.jonesy.moe/api/v1/upload"

build-win:
name: Windows Build
runs-on: windows-2019
permissions:
contents: write
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '21 3 * * 5'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: c-cpp
build-mode: manual

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Zig Compiler
uses: mlugg/setup-zig@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- if: matrix.build-mode == 'manual'
shell: bash
env:
DEMO_SIGN_PUBKEY: ${{ secrets.SAR_DEMO_SIGN_PUBKEY }}
DEMO_SIGN_PRIVKEY: ${{ secrets.SAR_DEMO_SIGN_PRIVKEY }}
run: |
zig build -Doptimize=Debug -Ddemo-sign-pubkey="$DEMO_SIGN_PUBKEY" -Ddemo-sign-privkey="$DEMO_SIGN_PRIVKEY" -Dcanary=true
cp zig-out/lib/sar.so sar.so

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ src/Features/Experimental/
docs/images/drawings/
sar.cvars
.clangd
.zig-cache
zig-out

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand Down
41 changes: 0 additions & 41 deletions Makefile

This file was deleted.

Loading
Loading