diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 9984d4d5..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/remove-old-artifacts.yml b/.github/workflows/remove-old-artifacts.yml deleted file mode 100644 index cb30c304..00000000 --- a/.github/workflows/remove-old-artifacts.yml +++ /dev/null @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..e063285c --- /dev/null +++ b/Jenkinsfile @@ -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 + } + } +}