Skip to content

Commit

Permalink
Merge pull request #393 from GSharker/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sonomirco authored Jan 2, 2023
2 parents ebb2a46 + 882dd00 commit 38fa717
Show file tree
Hide file tree
Showing 44 changed files with 1,571 additions and 709 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-and-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ env:

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
build-and-test:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dotnet: [ '3.1.x', '6.0.x']
steps:
- name: 🛎 Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 🚧 Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: ${{ matrix.dotnet }}

- name: ⚙️ Install dependencies
run: dotnet restore src/GShark/GShark.csproj
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

steps:
- name: 🛎 Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 🚧 Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x

- name: 🚧 Setup docfx
run: choco install docfx -y
Expand Down
77 changes: 26 additions & 51 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,55 @@ env:
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
PROJECT_PATH: 'src/GShark/GShark.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

on:
pull_request:
types: [closed]
branches:
- develop
- master

jobs:
build:
if: github.event.action == 'closed' && github.event.pull_request.merged == true
runs-on: ubuntu-20.04

steps:
permissions:
contents: write
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 👶 Draft release
uses: release-drafter/release-drafter@v5
id: release

- name: 🚧 Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: ⚙️ Get previous tag.
id: version
run: |
lastTag=`git tag -l --sort=-creatordate --format='%(refname:short)' | head -n 1`
echo "::set-output name=tag::$lastTag"
- name: ⚙️ Bump if alpha.
id: bump-with-alpha
uses: actions/github-script@v3
uses: actions/setup-dotnet@v3
with:
result-encoding: string
script: |
const incoming = "${{steps.version.outputs.tag}}"
console.log("Incoming Tag: " + incoming)
if(incoming.includes('alpha')) {
const oldNum = incoming.match(/alpha[.]*(\d+)/)[1]
const newNum = parseInt(oldNum)+1
const newTag = incoming.replace(/alpha.*\d+/, `alpha.${newNum}`)
console.log("New Tag: " + newTag)
return newTag
}
else {
const newTag =incoming +'-alpha.0'
console.log("New Tag: " + newTag)
return newTag
}
dotnet-version: 6.0.x

- name: 📖 Read release
run: echo ${{ steps.release.outputs.tag_name }}

- name: 🔧 Restore nuget with dotnet
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: 🧱 Build project
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release -p:Version=${{ steps.bump-with-alpha.outputs.result }}
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release -p:Version=${{ steps.release.outputs.tag_name }}

- name: 📦 Create the package
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.bump-with-alpha.outputs.result }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.release.outputs.tag_name }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: 🚀 Publish the package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE_URL }}

- name: 📘 Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 📰 Publish release
uses: eregon/publish-release@v1
with:
tag_name: ${{ steps.bump-with-alpha.outputs.result }}
release_name: ${{ steps.bump-with-alpha.outputs.result }}
body: |
### PR Title
${{ github.event.pull_request.title }}
${{ github.event.pull_request.body }}
draft: false
prerelease: false
release_id: ${{ steps.release.outputs.id }}
17 changes: 0 additions & 17 deletions .github/workflows/generate_diagram.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:

steps:
- name: 🛎 Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 🚧 Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x

- name: 🔧 Restore nuget with dotnet
run: dotnet restore ${{ env.PROJECT_PATH }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
permissions:
contents: write
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 👶 Draft release
uses: release-drafter/release-drafter@v5
18 changes: 8 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We use GitHub issues to track:
* Proposing new features

if you are submitting a bug or suggesting an enhancement provide more information as possible.
### Bugs:
### 🐛 Bugs:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible.
When listing steps, **don't just say what you did, but explain how you did it**.
Expand All @@ -29,18 +29,16 @@ If the issues is approved, you will be assigned to the issue.
Once you get assegned to an issue you can start coding!

### All Code Changes Happen Through Pull Requests.
1. **Fork the repo** and create your branch from `develop`, we use `develop` for continuous development, so it will be always the most updated, `master` is only for releases.
2. **Create a topic branch** using the tags `feature`, `bug`, `refactor` based on the type if issue.
1. **Fork the repo** and create your branch from `master`, we develop following [trunk-based development](https://cloud.google.com/architecture/devops/devops-tech-trunk-based-development)
2. **Crete your branch**, the space where you will develop the new integrations.
* This should usally branch of from master.
* Please avoid working directly on the `master` branch.
* To quickly create a topic branch based on master, run `git checkout -b refactor/<name-of-the-topic>` example `refactor/nurbs-curve`.
3. From the topic branch **crete your branches**, this helps to keep track of sub-tasks that defines the issues.
* To quickly create a topic branch based on master, run `git checkout -b dev/<initial name and surname>/<name-of-the-task>` example `dev/mibi/review-point-at`.
4. If you've added code that should be tested, **add tests**.
5. If you've changed APIs, **update the documentation**.
6. **Ensure the test suite passes**.
7. Make sure your code lints.
8. Issue that pull request!
3. If you've added code that should be tested, **add tests**.
4. If you've changed APIs, **update the documentation**.
5. **Ensure the test suite passes**.
6. Make sure your code lints.
7. Issue that pull request!
* In the pull request, **outline what you did and link it to the specific issue** that you are resolving. This is a tremendous help for us in evaluation and acceptance.
* Once the pull request is in, **please do not delete the branch or close the pull request** (unless something is wrong with it).

Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
![Target Framework](https://img.shields.io/badge/Target%20Framework-.NetStandard2.0-blue.svg)
![Nuget](https://img.shields.io/nuget/v/GShark)
![](https://img.shields.io/badge/Framwork-.NetStandard2.0-blue?logo=.NET)
![Nuget](https://img.shields.io/nuget/v/GShark?logo=NuGet&color=004880)
[![Build and Test](https://github.com/GSharker/G-Shark/actions/workflows/build-and-test-on-pr.yml/badge.svg?branch=develop&event=pull_request)](https://github.com/GSharker/G-Shark/actions/workflows/build-and-test-on-pr.yml)
[![Build docs](https://github.com/GSharker/G-Shark/actions/workflows/build-docs.yml/badge.svg?branch=master)](https://github.com/GSharker/G-Shark/actions/workflows/build-docs.yml)

[![](https://dcbadge.vercel.app/api/server/RPz2XZEtbc?style=flat)](https://discord.gg/RPz2XZEtbc)
![](./media/gshark-banner.jpg "Geometry Shark")

# The project
Expand All @@ -19,10 +21,3 @@ There's a tonne of work to be done and we appreciate all the help we can get! If

## Documentation
[G-Shark Doc](https://gsharker.github.io/G-Shark/)

## Our Codebase
We've included the generated diagram by adding it to the README:

![Visualization of this repo](media/diagram.svg)

You can check out the whole GitHub Action at [diagram.yml](/.github/workflows/generate_diagram.yml). Notice that we're excluding the `ignore` and `.github` folders, using the `excluded_paths` config.
2 changes: 1 addition & 1 deletion media/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 38fa717

Please sign in to comment.