Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Pipelines and release #200

Merged
merged 3 commits into from
Oct 5, 2024
Merged
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
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
changelog:
categories:
- title: 🏕 Features
labels:
- '*'
exclude:
labels:
- dependencies
- title: 👒 Dependencies
labels:
- dependencies
60 changes: 38 additions & 22 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "Code Analysis"

on:
push:
push: # The master branch must be analyzed on a new commit
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
# Any PR on master must be analyzed
branches: [ master ]
schedule:
- cron: '39 18 * * 0'
workflow_dispatch:
workflow_dispatch: # CodeQL can be triggered manually

jobs:
analyze:
name: Analyze
runs-on: [self-hosted, windows-latest]
analyzeQL:
name: Analyze with CodeQL
# runs-on: [windows-latest] # may cause Out of Memory errors
runs-on: [self-hosted]

permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

strategy:
fail-fast: false
Expand All @@ -33,20 +28,41 @@ jobs:

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

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


- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 7.x
dotnet-version: ${{vars.DOTNET_VERSION}}

- run: dotnet restore
- run: dotnet build ./FASTER.sln --configuration Debug

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

AnalysisSonar:
name: Analyze with SonarCloud
runs-on: ubuntu-latest
permissions:
pull-requests: write # allows SonarCloud to decorate PRs with analysis results

steps:
- name: Analyze with SonarCloud

# You can pin the exact commit or the version.
uses: SonarSource/sonarcloud-github-action@v3
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
# Additional arguments for the SonarScanner CLI
args:
-Dsonar.projectKey=Foxlider_FASTER
-Dsonar.organization=foxlicorp
projectBaseDir: .
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
identifier: Foxlider.FASTER
installers-regex: 'Release_x64.zip'
max-versions-to-keep: 5
token: ${{ secrets.WINGET_TOKEN }} # Classic Personal Access Token with [public_repo, workflow] scopes
# Classic Personal Access Token with [public_repo, workflow] scopes
token: ${{ secrets.WINGET_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: "Release Generator"

# after successful analysis on the main branch, a new pre-release is generated
on:
workflow_run:
workflows: [Code Analysis]
types: [completed]
branches: [master]

jobs:

# BUILD APP
build:

strategy:
matrix:
runtime: [x64, x86]

runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on

env:
Configuration: Release
Solution_Name: FASTER # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: FASTERTests\FASTERTests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: FASTER # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: FASTER.App.Package\FASTER.Package.wapproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{vars.DOTNET_VERSION}}

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: dotnet restore

# Build
- name: Build the application
run: dotnet build --configuration $env:Configuration -a $env:Runtime ./FASTER/FASTER.csproj
env:
Runtime: ${{ matrix.runtime }}

# Pub
- name: Publish the application $env:Runtime
run: dotnet publish --configuration $env:Configuration -a $env:Runtime --self-contained true /p:useapphost=true --output .\Release_Nightly_$env:Runtime ./FASTER/FASTER.csproj
env:
Runtime: ${{ matrix.runtime }}


# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
# - name: Upload build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: Release_Nightly_${{ env.Runtime }}
# path: .\FASTER_Nightly_${{ env.Runtime }}
# env:
# Runtime: ${{ matrix.runtime }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
#Upload Artifacts
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Runtime: ${{ matrix.runtime }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: .\FASTER_Nightly_${{ env.Runtime }}.zip
asset_name: Release_Nightly_${{ env.Runtime }}.zip
asset_content_type: application/zip

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ For changes that address core functionality or would require breaking changes (e
In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr)
While a bit different, it is generally the same idea.

1. Fork the repository to your own Github account
1. Fork the repository to your own GitHub account
2. Clone the project to your machine
3. Create a branch locally with a succinct but descriptive name. It is preferred to branch from the current update branch that should be named feature/Update-X.Y
3. Create a branch locally with a succinct but descriptive name. It is preferred to branch from the current update branch that should be named `feature/shortName`
4. Commit changes to the branch
5. Following any formatting and testing guidelines specific to this repo
6. Push changes to your fork
Expand Down
Loading