Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into feature/nsubstitute
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepami committed Aug 11, 2024
2 parents 15f24fd + 4ca963b commit efb02fc
Show file tree
Hide file tree
Showing 23 changed files with 280 additions and 251 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/cla.yml

This file was deleted.

53 changes: 32 additions & 21 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Develop Workflow

on:
push:
branches:
- '**'
branches-ignore:
- 'release'
pull_request_target:
branches:
- '**'
branches-ignore:
- 'release'

permissions:
actions: write
Expand All @@ -18,23 +18,39 @@ permissions:
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Cache NuGet packages
uses: actions/cache@v4
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: '5.12.0'
- name: Determine Version
id: version_step
uses: gittools/actions/gitversion/execute@v3.0.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*') }}
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
run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Release -v n
- name: Unit Tests
run: |
dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj --no-build -v n
Expand All @@ -53,17 +69,6 @@ jobs:
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/CodeCoverageSummary@v1.3.0
with:
filename: ./tests/HydraScript.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.2.1
with:
Expand All @@ -77,3 +82,9 @@ jobs:
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
91 changes: 68 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,58 @@ name: Release Workflow

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- 'release'

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@v4
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
fetch-depth: 0
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: '5.12.0'
- name: Determine Version
id: version_step
uses: gittools/actions/gitversion/execute@v3.0.0
with:
useConfigFile: true
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
with:
versionSpec: '0.18.x'
- name: Create release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/create@v3.0.0
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-arm64-latest
- os: macos-14
rid: osx-arm64
type: application/x-mach-binary
- os: windows-latest
rid: win-x64
type: application/x-dosexec
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
Expand All @@ -46,16 +62,45 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
with:
versionSpec: '0.18.x'
- name: Publish
run: |
mkdir output
dotnet publish ./src/HydraScript/HydraScript.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: hydrascript-${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}
asset_path: ./output/HydraScript${{ 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/addasset@v3.0.0
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/setup@v3.0.0
with:
versionSpec: '0.18.x'
- name: Publish release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/publish@v3.0.0
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/close@v3.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: 'Stepami'
repository: 'hydrascript'
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}'
5 changes: 3 additions & 2 deletions ExtendedJavaScriptSubset.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
.gitignore = .gitignore
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md
contributor-licence-agreement.md = contributor-licence-agreement.md
LICENSE = LICENSE
Readme.md = Readme.md
SECURITY.md = SECURITY.md
hydrascript-logo.jpg = hydrascript-logo.jpg
GitVersion.yml = GitVersion.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolder", "{54CBE5A7-3C3E-44ED-B877-7B08A818083B}"
Expand All @@ -22,7 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolde
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}"
ProjectSection(SolutionItems) = preProject
.github\workflows\cla.yml = .github\workflows\cla.yml
.github\workflows\develop.yml = .github\workflows\develop.yml
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
Expand Down Expand Up @@ -62,6 +62,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{04AB
samples\this.js = samples\this.js
samples\typeresolving.js = samples\typeresolving.js
samples\vec2d.js = samples\vec2d.js
samples\cycled.js = samples\cycled.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-1942-46D6-954E-9A1647BBDF10}"
Expand Down
7 changes: 7 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mode: Mainline
branches:
release:
increment: None
ignore:
sha: []
merge-message-formats: {}
Loading

0 comments on commit efb02fc

Please sign in to comment.