Skip to content

Commit

Permalink
Merge pull request #96 from Stepami/feature/git-release-manager
Browse files Browse the repository at this point in the history
Feature/git release manager +semver:skip
  • Loading branch information
Stepami authored Aug 11, 2024
2 parents 9c83de8 + 20bf5be commit d22e358
Show file tree
Hide file tree
Showing 377 changed files with 7,518 additions and 6,306 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/cla.yml

This file was deleted.

87 changes: 54 additions & 33 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
98 changes: 73 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
_UpgradeReport_Files
[Pp]ackages

tests/**/coverage.cobertura.xml

Thumbs.db
Desktop.ini
.DS_Store
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Contributions are welcomed! Here's a few things to know:
## Steps to Contributing

Here are the basic steps to get started with your first contribution. Please reach out with any questions.
1. Use [open issues](https://github.com/stepami/extended-js-subset/issues) to discuss the proposed changes. Create an issue describing changes if necessary to collect feedback. Also, please use provided labels to tag issues so everyone can easily sort issues of interest.
1. Use [open issues](https://github.com/stepami/hydrascript/issues) to discuss the proposed changes. Create an issue describing changes if necessary to collect feedback. Also, please use provided labels to tag issues so everyone can easily sort issues of interest.
1. [Fork the repo](https://help.github.com/articles/fork-a-repo/) in order if you want to make and test local changes.
1. Create a new branch **from master** for the issue. We suggest prefixing the branch with type of contribution (`bugfix`/`feature`), your username and then a descriptive title: (e.g. `bugfix/user1/object-comparision` or `feature/user2/variable-initialization-check`)
1. Make code changes.
Expand Down
Loading

0 comments on commit d22e358

Please sign in to comment.