mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 12:42:22 -04:00
Workflow notify
This commit is contained in:
parent
17e62f00d7
commit
191796cc32
19
.github/actions/notify_success/action.yml
vendored
Normal file
19
.github/actions/notify_success/action.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: Notify success
|
||||||
|
description: Sends a notification that a workflow has finished
|
||||||
|
inputs:
|
||||||
|
DESTINATION_URL:
|
||||||
|
description: 'Webhook notification URL'
|
||||||
|
type: string
|
||||||
|
WORKFLOW_NAME:
|
||||||
|
description: 'Workflow name'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Notify failure
|
||||||
|
if: ${{ inputs.DESTINATION_URL != '' }}
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
curl ${{ inputs.DESTINATION_URL }}/${{ inputs.WORKFLOW_NAME }}/${{ github.sha }}
|
57
.github/workflows/build.yml
vendored
57
.github/workflows/build.yml
vendored
@ -6,6 +6,9 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
#============================================
|
||||||
|
# ============== .NET 2.0 BUILD =============
|
||||||
|
# ===========================================
|
||||||
build-mono2:
|
build-mono2:
|
||||||
if: github.ref_name == github.event.repository.default_branch
|
if: github.ref_name == github.event.repository.default_branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -29,6 +32,16 @@ jobs:
|
|||||||
SOURCE_FILE: 'bin/Release'
|
SOURCE_FILE: 'bin/Release'
|
||||||
DEST_NAME: 'MCGalaxy_net2.0'
|
DEST_NAME: 'MCGalaxy_net2.0'
|
||||||
|
|
||||||
|
- uses: ./.github/actions/notify_success
|
||||||
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
|
with:
|
||||||
|
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
|
||||||
|
WORKFLOW_NAME: 'net20'
|
||||||
|
|
||||||
|
|
||||||
|
#============================================
|
||||||
|
# ============== .NET 4.0 BUILD =============
|
||||||
|
# ===========================================
|
||||||
build-mono4:
|
build-mono4:
|
||||||
if: github.ref_name == github.event.repository.default_branch
|
if: github.ref_name == github.event.repository.default_branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -61,7 +74,16 @@ jobs:
|
|||||||
SOURCE_FILE: 'bin/Release'
|
SOURCE_FILE: 'bin/Release'
|
||||||
DEST_NAME: 'MCGalaxy-infid'
|
DEST_NAME: 'MCGalaxy-infid'
|
||||||
|
|
||||||
|
- uses: ./.github/actions/notify_success
|
||||||
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
|
with:
|
||||||
|
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
|
||||||
|
WORKFLOW_NAME: 'net40'
|
||||||
|
|
||||||
|
|
||||||
|
#============================================
|
||||||
|
# ============== .NET 6.0 BUILD =============
|
||||||
|
# ===========================================
|
||||||
build-dotnet6:
|
build-dotnet6:
|
||||||
if: github.ref_name == github.event.repository.default_branch
|
if: github.ref_name == github.event.repository.default_branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -75,18 +97,18 @@ jobs:
|
|||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore CLI/MCGalaxyCLI_dotnet6.csproj
|
run: dotnet restore CLI/MCGalaxyCLI_dotnet6.csproj
|
||||||
- name: Build
|
- name: Build
|
||||||
id: compile_net
|
id: compile
|
||||||
run: |
|
run: |
|
||||||
dotnet build CLI/MCGalaxyCLI_dotnet6.csproj --no-restore
|
dotnet build CLI/MCGalaxyCLI_dotnet6.csproj --no-restore
|
||||||
|
|
||||||
- uses: ./.github/actions/notify_failure
|
- uses: ./.github/actions/notify_failure
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'failure' }}
|
if: ${{ always() && steps.compile.outcome == 'failure' }}
|
||||||
with:
|
with:
|
||||||
NOTIFY_MESSAGE: 'Failed to compile MCGalaxy dotnet build'
|
NOTIFY_MESSAGE: 'Failed to compile MCGalaxy dotnet build'
|
||||||
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
|
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
|
||||||
|
|
||||||
- uses: ./.github/actions/upload_build
|
- uses: ./.github/actions/upload_build
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'success' }}
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
SOURCE_FILE: 'CLI/bin/Debug/net6.0'
|
SOURCE_FILE: 'CLI/bin/Debug/net6.0'
|
||||||
DEST_NAME: 'MCGalaxy-dotnet6.0'
|
DEST_NAME: 'MCGalaxy-dotnet6.0'
|
||||||
@ -96,7 +118,7 @@ jobs:
|
|||||||
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r win-x64 --self-contained
|
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r win-x64 --self-contained
|
||||||
|
|
||||||
- uses: ./.github/actions/upload_build
|
- uses: ./.github/actions/upload_build
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'success' }}
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
SOURCE_FILE: 'CLI/bin/Debug/net6.0/win-x64/publish'
|
SOURCE_FILE: 'CLI/bin/Debug/net6.0/win-x64/publish'
|
||||||
DEST_NAME: 'MCGalaxy-win64-standalone'
|
DEST_NAME: 'MCGalaxy-win64-standalone'
|
||||||
@ -106,7 +128,7 @@ jobs:
|
|||||||
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r linux-x64 --self-contained
|
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r linux-x64 --self-contained
|
||||||
|
|
||||||
- uses: ./.github/actions/upload_build
|
- uses: ./.github/actions/upload_build
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'success' }}
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
SOURCE_FILE: 'CLI/bin/Debug/net6.0/linux-x64/publish'
|
SOURCE_FILE: 'CLI/bin/Debug/net6.0/linux-x64/publish'
|
||||||
DEST_NAME: 'MCGalaxy-linux64-standalone'
|
DEST_NAME: 'MCGalaxy-linux64-standalone'
|
||||||
@ -116,12 +138,22 @@ jobs:
|
|||||||
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r osx-x64 --self-contained
|
run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r osx-x64 --self-contained
|
||||||
|
|
||||||
- uses: ./.github/actions/upload_build
|
- uses: ./.github/actions/upload_build
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'success' }}
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
SOURCE_FILE: 'CLI/bin/Debug/net6.0/osx-x64/publish'
|
SOURCE_FILE: 'CLI/bin/Debug/net6.0/osx-x64/publish'
|
||||||
DEST_NAME: 'MCGalaxy-mac64-standalone'
|
DEST_NAME: 'MCGalaxy-mac64-standalone'
|
||||||
|
|
||||||
|
|
||||||
|
- uses: ./.github/actions/notify_success
|
||||||
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
|
with:
|
||||||
|
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
|
||||||
|
WORKFLOW_NAME: 'net60'
|
||||||
|
|
||||||
|
|
||||||
|
#============================================
|
||||||
|
# ============== .NET 8.0 BUILD =============
|
||||||
|
# ===========================================
|
||||||
build-dotnet8:
|
build-dotnet8:
|
||||||
if: github.ref_name == github.event.repository.default_branch
|
if: github.ref_name == github.event.repository.default_branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -135,18 +167,25 @@ jobs:
|
|||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore CLI/MCGalaxyCLI_dotnet8.csproj
|
run: dotnet restore CLI/MCGalaxyCLI_dotnet8.csproj
|
||||||
- name: Build
|
- name: Build
|
||||||
id: compile_net
|
id: compile
|
||||||
run: |
|
run: |
|
||||||
dotnet build CLI/MCGalaxyCLI_dotnet8.csproj --no-restore
|
dotnet build CLI/MCGalaxyCLI_dotnet8.csproj --no-restore
|
||||||
|
|
||||||
- uses: ./.github/actions/notify_failure
|
- uses: ./.github/actions/notify_failure
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'failure' }}
|
if: ${{ always() && steps.compile.outcome == 'failure' }}
|
||||||
with:
|
with:
|
||||||
NOTIFY_MESSAGE: 'Failed to compile MCGalaxy dotnet build'
|
NOTIFY_MESSAGE: 'Failed to compile MCGalaxy dotnet build'
|
||||||
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
|
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
|
||||||
|
|
||||||
- uses: ./.github/actions/upload_build
|
- uses: ./.github/actions/upload_build
|
||||||
if: ${{ always() && steps.compile_net.outcome == 'success' }}
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
SOURCE_FILE: 'CLI/bin/Debug/net8.0'
|
SOURCE_FILE: 'CLI/bin/Debug/net8.0'
|
||||||
DEST_NAME: 'MCGalaxy-dotnet8.0'
|
DEST_NAME: 'MCGalaxy-dotnet8.0'
|
||||||
|
|
||||||
|
|
||||||
|
- uses: ./.github/actions/notify_success
|
||||||
|
if: ${{ always() && steps.compile.outcome == 'success' }}
|
||||||
|
with:
|
||||||
|
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
|
||||||
|
WORKFLOW_NAME: 'net80'
|
Loading…
x
Reference in New Issue
Block a user