Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.yml #70

Merged
merged 14 commits into from
Jan 6, 2024
Merged
53 changes: 53 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
commitish: "refs/heads/master"
name-template: 'v$RESOLVED_VERSION 🚀'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: '🚀 Features'
label: 'enhancement'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '🔧 Refactoring'
label: 'refactor'
- title: '📖 Documentation'
label: 'documentation'
- title: '✅ Tests'
label: 'test'
- title: 'Other Changes'
label: '*'

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

template: |
## Changes
$CHANGES

autolabeler:
- label: enhancement
branch:
- '/^feat(ure)?[/-].+/'
- label: bug
branch:
- '/^fix[/-].+/'
- label: test
branch:
- '/^test[/-].+/'
- label: refactor
branch:
- '/^refactor[/-].+/'
- label: documentation
branch:
- '/^doc[/-].+/'
61 changes: 57 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,72 @@ on:
types: [ opened, synchronize, reopened ]

jobs:
build:
build-linux:
runs-on: ubuntu-latest
env:
Builder: 1
steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore Application/BocchiTracker.UnitTests.sln

- name: Build unit Test
run: dotnet build --no-restore Application/BocchiTracker.UnitTests.sln

- name: Execute unit test
run: dotnet test --no-build --verbosity normal Application/BocchiTracker.UnitTests.sln

build-windows:
runs-on: windows-latest
env:
Builder: 1
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET on Windows
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore Application/BocchiTracker.UnitTests.sln
- name: Build

- name: Build unit Test
run: dotnet build --no-restore Application/BocchiTracker.UnitTests.sln
- name: Test

- name: Execute unit test
run: dotnet test --no-build --verbosity normal Application/BocchiTracker.UnitTests.sln

- name: Build application in debug config
run: dotnet build Application/BocchiTracker.WPF.sln -c Debug

- name: Build application in release config
run: dotnet build Application/BocchiTracker.WPF.sln -c Release

build-mac:
runs-on: macos-latest
env:
Builder: 1
steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore Application/BocchiTracker.UnitTests.sln

- name: Build unit Test
run: dotnet build --no-restore Application/BocchiTracker.UnitTests.sln

- name: Execute unit test
run: dotnet test --no-build --verbosity normal Application/BocchiTracker.UnitTests.sln
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release Drafter

on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
create_draft_release:
permissions:
contents: write
pull-requests: write

runs-on: windows-latest

steps:
- name: Delete drafts
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release draft
uses: release-drafter/release-drafter@v5
id: create_draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- name: Build C# application
run: dotnet build Application/BocchiTracker.WPF.sln -c Release

- name: Archive application
run: Compress-Archive -Path "Application/WPF/Artifact/Release/net7.0-windows" -DestinationPath "BocchiTracker.zip"

- name: Archive UnrealEngine plugin
run: Compress-Archive -Path "Plugins/UnrealEngine" -DestinationPath "UnrealEngine.zip"

- name: Archive Unity plugin
run: Compress-Archive -Path "Plugins/Unity" -DestinationPath "Unity.zip"

- name: Archive Godot plugin
run: Compress-Archive -Path "Plugins/Godot" -DestinationPath "Godot.zip"

- name: Upload Application
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
asset_path: ./BocchiTracker.zip
asset_name: BocchiTracker.zip
asset_content_type: application/zip

- name: Upload UnrealEngine plugin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
asset_path: ./UnrealEngine.zip
asset_name: UnrealEngine.zip
asset_content_type: application/zip

- name: Upload Unity plugin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
asset_path: ./Unity.zip
asset_name: Unity.zip
asset_content_type: application/zip

- name: Upload Godot plugin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
asset_path: ./Godot.zip
asset_name: Godot.zip
asset_content_type: application/zip
Loading