Skip to content

Commit ee91c94

Browse files
Initial commit
0 parents  commit ee91c94

81 files changed

Lines changed: 10235 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
pull_request
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: 'ubuntu-latest'
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
language: [ 'csharp' ]
30+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
31+
# Use only 'java' to analyze code written in Java, Kotlin or both
32+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
33+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v2
42+
with:
43+
languages: ${{ matrix.language }}
44+
# If you wish to specify custom queries, you can do so here or in a config file.
45+
# By default, queries listed here will override any specified in a config file.
46+
# Prefix the list here with "+" to use these queries and those in the config file.
47+
48+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
49+
queries: security-and-quality
50+
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
# - name: Autobuild
55+
# uses: github/codeql-action/autobuild@v2
56+
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
59+
60+
# If the Autobuild fails above, remove it and uncomment the following three lines.
61+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
62+
63+
- name: Setup .NET
64+
uses: actions/setup-dotnet@v1
65+
with:
66+
dotnet-version: '10.0.x'
67+
68+
- run: |
69+
echo "running custom build action..."
70+
dotnet build ./src/Spice86.Audio.slnx
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2
74+
with:
75+
category: "/language:${{matrix.language}}"

.github/workflows/nuget.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test and Publish NuGet
2+
3+
# Trigger the workflow on push to master
4+
on:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
build:
11+
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-latest, ubuntu-latest]
15+
fail-fast: false
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v1
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: '10.0.x'
26+
27+
- name: Package NuGet
28+
working-directory: ./src/Spice86.Audio
29+
run: dotnet pack --include-symbols --include-source --configuration Release -p:NoWarn=NU5104
30+
31+
- name: Upload NuGet Spice86.Audio
32+
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'
33+
working-directory: ./src/Spice86.Audio/bin/Release
34+
run: dotnet nuget push Spice86.Audio.11.1.0.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate

.github/workflows/pr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests
2+
3+
# Trigger the workflow on PRs
4+
on:
5+
pull_request
6+
7+
jobs:
8+
build:
9+
10+
strategy:
11+
matrix:
12+
os: [macos-latest, windows-latest, ubuntu-latest]
13+
fail-fast: false
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '10.0.x'
24+
25+
- name: Build with dotnet
26+
working-directory: ./src
27+
run: dotnet build --configuration Release

.github/workflows/prerelease.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: "pre-release"
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
pre-release:
14+
name: "Pre Release"
15+
runs-on: "ubuntu-latest"
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Determine prerelease version
21+
run: |
22+
COMMIT_SHA=$(git rev-parse --short HEAD)
23+
echo "PRERELEASE_VERSION=11.0.0-${COMMIT_SHA}" >> $GITHUB_ENV
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '10.0.x'
29+
30+
- name: Install zip
31+
uses: montudor/action-zip@v1
32+
33+
- name: Build with dotnet
34+
working-directory: ./src/Spice86.Audio
35+
run: |
36+
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/linux
37+
dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/linux-arm64
38+
dotnet publish -c Release -r win-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/windows-arm64
39+
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/windows
40+
dotnet publish -c Release -r osx-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/macos
41+
dotnet publish -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Release/macos-arm64
42+
dotnet publish -c Debug -r linux-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/linux
43+
dotnet publish -c Debug -r linux-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/linux-arm64
44+
dotnet publish -c Debug -r win-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/windows-arm64
45+
dotnet publish -c Debug -r win-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/windows
46+
dotnet publish -c Debug -r osx-x64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/macos
47+
dotnet publish -c Debug -r osx-arm64 --self-contained true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -o ../Debug/macos-arm64
48+
49+
- name: Zip Debug output
50+
run: zip -qq -r DebugBuild.zip Debug
51+
working-directory: ./src/Spice86.Audio/bin
52+
53+
- name: Zip Release output
54+
run: zip -qq -r ReleaseBuild.zip Release
55+
working-directory: ./src/Spice86.Audio/bin
56+
57+
# Suppress the following warnings during NuGet packing:
58+
# 1591 - Missing XML documentation
59+
# NU5104 - Package icon issues
60+
# NU1507 - Package validation issues
61+
# Semicolons are URL-encoded as %3B for compatibility.
62+
- name: Pack prerelease NuGet packages
63+
working-directory: ./src
64+
run: dotnet pack Spice86.Audio.slnx --configuration Release --include-symbols --include-source -p:PackageVersion=${PRERELEASE_VERSION} -p:SymbolPackageFormat=snupkg -p:NoWarn=1591%3BNU5104%3BNU1507
65+
66+
- name: Publish prerelease NuGet packages
67+
env:
68+
PACKAGE_VERSION: ${{ env.PRERELEASE_VERSION }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
run: |
71+
set -euo pipefail
72+
SOURCE="https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
73+
for project in Spice86.Audio; do
74+
PACKAGE_PATH="./src/${project}/bin/Release/${project}.${PACKAGE_VERSION}.nupkg"
75+
if [ -f "$PACKAGE_PATH" ]; then
76+
dotnet nuget push "$PACKAGE_PATH" --source "$SOURCE" --api-key "$GITHUB_TOKEN" --skip-duplicate
77+
else
78+
echo "::error::Package not found: $PACKAGE_PATH"
79+
exit 1
80+
fi
81+
done
82+
83+
- name: Publish GitHub Release
84+
uses: "marvinpinto/action-automatic-releases@latest"
85+
with:
86+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
87+
automatic_release_tag: "latest"
88+
prerelease: true
89+
title: "Development Build"
90+
files: |
91+
./src/Spice86/bin/DebugBuild.zip
92+
./src/Spice86/bin/ReleaseBuild.zip

0 commit comments

Comments
 (0)