Browse Source

Merge branch 'main' into connected-models

pull/5/head
Ionite 1 year ago committed by GitHub
parent
commit
94a6a961c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 46
      .github/workflows/build.yml
  2. 20
      .github/workflows/remove-old-artifacts.yml
  3. 31
      Jenkinsfile

46
.github/workflows/build.yml

@ -1,46 +0,0 @@
name: .NET Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Cache NuGet packages
id: cache
uses: actions/cache@v1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish -o out -c Release --no-restore --self-contained false -p:IncludeNativeLibrariesForSelfExtract=false
- name: Upload Artifacts
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: build
path: |
out

20
.github/workflows/remove-old-artifacts.yml

@ -1,20 +0,0 @@
name: Remove old artifacts
on:
workflow_dispatch:
schedule:
# Every day at 1am
- cron: '0 1 * * *'
jobs:
remove-old-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 day'
skip-tags: true
skip-recent: 1

31
Jenkinsfile vendored

@ -0,0 +1,31 @@
node("Windows") {
def repoName = "StabilityMatrix"
def author = "ionite34"
def version = ""
stage('Clean') {
deleteDir()
}
stage('Checkout') {
git branch: env.BRANCH_NAME, credentialsId: 'Ionite', url: "https://github.com/${author}/${repoName}.git"
}
stage('Test') {
bat "dotnet test StabilityMatrix.Tests"
}
stage('Publish') {
bat "dotnet publish -c Release -o out -r win-x64 --self-contained true"
}
stage('Set Version') {
version = VersionNumber projectStartDate: '', versionNumberString: '${BUILD_DATE_FORMATTED, "yy"}.${BUILD_WEEK}.${BUILDS_THIS_WEEK}', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
}
if (env.BRANCH_NAME == "main") {
stage ('Archive Artifacts') {
archiveArtifacts artifacts: 'out/**/*.*', followSymlinks: false
}
}
}
Loading…
Cancel
Save