Skip to content

Commit

Permalink
Remove IntelliWait, use Github Actions for deployment, minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Sep 1, 2022
1 parent d3156a9 commit 12c6912
Show file tree
Hide file tree
Showing 24 changed files with 140 additions and 1,314 deletions.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

defaults:
run:
shell: pwsh

jobs:
build-and-test:
name: build-and-test on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.1.x
3.1.x
6.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -p:ContinuousIntegrationBuild=True --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
75 changes: 75 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy

on:
release:
types: [created]

defaults:
run:
shell: pwsh

env:
baseVersion: 1.0.0

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.1.x
3.1.x
6.x
- name: Restore dependencies
run: dotnet restore
- name: Set Version
run: |
echo "${{ github.ref }}"
if ("${{ github.ref }}".startsWith("refs/tags/v")) {
$tagVersion = "${{ github.ref }}".substring(11)
echo "buildVersion=$tagVersion.${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "nugetVersion=$tagVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "preRelease=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "buildVersion=${{ env.baseVersion }}.${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "nugetVersion=${{ env.baseVersion }}-ci${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Build
run: dotnet build -p:Version=${{ env.buildVersion }} -p:ContinuousIntegrationBuild=True --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Pack
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet pack -p:PackageVersion=${{ env.nugetVersion }} --configuration Release -o ${{env.DOTNET_ROOT}}/IntelliTect.UtilitiesPack --no-build
- name: Upload Artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v2
with:
name: NuGet
path: ${{env.DOTNET_ROOT}}/IntelliTect.UtilitiesPack

deploy:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build-and-test
environment:
name: 'Production'
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: NuGet
- name: Push NuGet
run: |
$tagVersion = "${{ github.ref }}".substring(11)
echo "tagVersion=$tagVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
dotnet nuget push IntelliTect.Utilities.$tagVersion.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
- name: Upload nupkg to Releases
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
generate_release_notes: true
files: IntelliTect.Utilities.${{ env.tagVersion }}.nupkg
15 changes: 0 additions & 15 deletions IntelliTect.IntelliWait.Tests/BaseTest.cs

This file was deleted.

151 changes: 0 additions & 151 deletions IntelliTect.IntelliWait.Tests/ExpectedExceptionsTests.cs

This file was deleted.

77 changes: 0 additions & 77 deletions IntelliTect.IntelliWait.Tests/FakeTestClass.cs

This file was deleted.

23 changes: 0 additions & 23 deletions IntelliTect.IntelliWait.Tests/IntelliTect.IntelliWait.Tests.csproj

This file was deleted.

Loading

0 comments on commit 12c6912

Please sign in to comment.