-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from Stepami/feature/git-release-manager
Feature/git release manager +semver:skip
- Loading branch information
Showing
377 changed files
with
7,518 additions
and
6,306 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,68 +2,89 @@ name: Develop Workflow | |
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
branches-ignore: | ||
- 'release_test' | ||
pull_request_target: | ||
branches-ignore: | ||
- 'release_test' | ||
|
||
permissions: | ||
actions: write | ||
checks: write | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v3 | ||
dotnet-version: 8.0.x | ||
- name: Setup GitVersion | ||
uses: gittools/actions/gitversion/setup@v3.0.0 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*') }} | ||
versionSpec: '5.12.0' | ||
- name: Determine Version | ||
id: version_step | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
- name: Push New Version Tag | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
run: | | ||
$gv = 'v${{ steps.version_step.outputs.majorMinorPatch }}' #gitversion result | ||
$lt = $( git describe --tags --abbrev=0 ) # last tag version result | ||
if ( -Not ( $gv -eq $lt ) ) | ||
{ | ||
git tag $gv | ||
git push origin --tags | ||
} | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore -c Release -v n | ||
- name: Test | ||
run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Release -v n | ||
- name: Unit Tests | ||
run: | | ||
dotnet test -c Release --no-build -v n --filter="Category=Unit" | ||
dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj --no-build -v n | ||
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Unit" | ||
mkdir coverage-report | ||
- name: Code Coverage Summary Report For Merge Request | ||
if: github.event_name == 'pull_request' | ||
if: github.event_name == 'pull_request_target' | ||
uses: 5monkeys/cobertura-action@master | ||
with: | ||
path: ./Interpreter.Tests/coverage.cobertura.xml | ||
path: ./tests/HydraScript.Tests/coverage.cobertura.xml | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
minimum_coverage: 80 | ||
minimum_coverage: 20 | ||
fail_below_threshold: true | ||
show_class_names: true | ||
show_missing: true | ||
link_missing_lines: true | ||
show_branch: true | ||
only_changed_files: true | ||
- name: Code Coverage Summary Report For Master | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
uses: irongut/[email protected] | ||
with: | ||
filename: ./Interpreter.Tests/coverage.cobertura.xml | ||
badge: true | ||
fail_below_min: false | ||
format: markdown | ||
hide_branch_rate: true | ||
hide_complexity: true | ||
thresholds: '80 100' | ||
- name: ReportGenerator | ||
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.10 | ||
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 | ||
with: | ||
reports: './Interpreter.Tests/coverage.cobertura.xml' | ||
reports: './tests/HydraScript.Tests/coverage.cobertura.xml' | ||
targetdir: './coverage-report' | ||
- name: Upload coverage report artifact | ||
if: github.event_name == 'push' | ||
uses: actions/upload-artifact@v2.2.3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: CoverageReport | ||
path: coverage-report | ||
- name: Integration Tests | ||
run: dotnet test -c Release --no-build -v n --filter="Category=Integration" | ||
- name: Upload Windows Build | ||
if: github.ref != 'refs/heads/master' && github.event_name == 'push' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows_build_${{ steps.version_step.outputs.fullSemVer }} | ||
path: ./src/HydraScript/bin/Release/net8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,57 +2,105 @@ name: Release Workflow | |
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
branches: | ||
- 'release_test' | ||
|
||
jobs: | ||
create-release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
outputs: | ||
determined_version: ${{ steps.version_step.outputs.majorMinorPatch }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Create release | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.12.0' | ||
- name: Determine Version | ||
id: version_step | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
- name: Setup GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
versionSpec: '0.18.x' | ||
- name: Create release with GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
owner: 'Stepami' | ||
repository: 'hydrascript' | ||
milestone: 'v${{ steps.version_step.outputs.majorMinorPatch }}' | ||
name: 'v${{ steps.version_step.outputs.majorMinorPatch }}' | ||
|
||
upload-release-assets: | ||
name: Upload release assets | ||
needs: create-release | ||
outputs: | ||
determined_version: ${{ needs.create-release.outputs.determined_version }} | ||
strategy: | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
rid: linux-x64 | ||
type: application/x-pie-executable | ||
- os: macos-latest | ||
- os: macos-12 | ||
rid: osx-x64 | ||
type: application/x-mach-binary | ||
- os: macos-14 | ||
rid: osx-arm64 | ||
- os: windows-latest | ||
rid: win-x64 | ||
type: application/x-dosexec | ||
runs-on: ${{ matrix.config.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
- name: Setup GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
versionSpec: '0.18.x' | ||
- name: Publish | ||
run: | | ||
mkdir output | ||
dotnet publish ./Interpreter/Interpreter.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output | ||
- name: Upload release assets | ||
uses: shogo82148/actions-upload-release-asset@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_name: interpreter-${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} | ||
asset_path: ./output/Interpreter${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} | ||
asset_content_type: ${{ matrix.config.type }} | ||
dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded -p:Version=${{ needs.create-release.outputs.determined_version }} --self-contained false -o ./output | ||
- name: Rename Executable | ||
run: mv ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} | ||
- name: Add asset to a release with GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
owner: 'Stepami' | ||
repository: 'hydrascript' | ||
milestone: 'v${{ needs.create-release.outputs.determined_version }}' | ||
assets: ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} | ||
|
||
publish-release: | ||
name: Publish release | ||
runs-on: ubuntu-latest | ||
needs: upload-release-assets | ||
steps: | ||
- name: Setup GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
versionSpec: '0.18.x' | ||
- name: Publish release with GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
owner: 'Stepami' | ||
repository: 'hydrascript' | ||
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}' | ||
- name: Close release with GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
owner: 'Stepami' | ||
repository: 'hydrascript' | ||
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
_UpgradeReport_Files | ||
[Pp]ackages | ||
|
||
tests/**/coverage.cobertura.xml | ||
|
||
Thumbs.db | ||
Desktop.ini | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.