Skip to content

Commit

Permalink
Merge pull request #20 from XanatosX/feature/switch-to-nigtly-build
Browse files Browse the repository at this point in the history
Change dev builds to nighly builds
  • Loading branch information
XanatosX authored Sep 17, 2022
2 parents add19ed + e025708 commit 064411e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ jobs:
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish test
run: dotnet publish
42 changes: 34 additions & 8 deletions .github/workflows/create-latest-develop-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Recent develop build

on:
pull_request:
types: [closed]
branches: [ "develop" ]
workflow_dispatch:
schedule:
- cron: 0 0 * * *

env:
DEBUG: false
RELEASE_NAME: Recent develop build
REF_CHECKOUT_BRANCH: develop
RELEASE_NAME: Recent nightly build
APPLICATION_PROJECT_PATH: .\src\ModularToolManager\ModularToolManager.csproj
APPLICATION_PLUGIN_PROJECT_PATH: .\src\DefaultPlugins\DefaultPlugins.csproj
APPLICATION_PUBLISH_FOLDER: ./publish
Expand All @@ -17,13 +18,36 @@ env:
RELEASE_ARTIFACT_FOLDER: artifacts

jobs:
check-for-changes:
runs-on: ubuntu-latest
name: Check for changes in last 24 hours
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v3
if: ${{ env.DEBUG == 'true' }}
- uses: actions/checkout@v3
if: ${{ env.DEBUG == 'false' }}
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
- name: get latest commit and check it
id: should_run
continue-on-error: true
if: ${{ env.DEBUG == 'true' }} || ${{ github.event_name == 'schedule' }}
run: |
echo "::set-output name=should_run::true"
sha=$(git log -n 1 --pretty=format:"%H")
echo $sha
test -z $(git rev-list --after="24 hours" $sha) && echo "::set-output name=should_run::false"
check-build:
name: Check and Test build
if: github.event.pull_request.merged == true
if: ${{ needs.check-for-changes.outputs.should_run == 'true' }}
needs: [check-for-changes]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v2
Expand All @@ -37,12 +61,13 @@ jobs:
run: dotnet test --no-build --verbosity normal
create-windows-build:
name: Create Windows build
if: github.event.pull_request.merged == true
if: ${{ needs.check-for-changes.outputs.should_run == 'true' }}
needs: ["check-build"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v2
Expand Down Expand Up @@ -70,12 +95,13 @@ jobs:
if-no-files-found: error
create-linux-build:
name: Create Linux build
if: github.event.pull_request.merged == true
if: ${{ needs.check-for-changes.outputs.should_run == 'true' }}
needs: ["check-build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v2
Expand Down Expand Up @@ -103,7 +129,7 @@ jobs:
if-no-files-found: error
create-release:
name: Create GitHub Release
if: github.event.pull_request.merged == true
if: ${{ needs.check-for-changes.outputs.should_run == 'true' }}
needs: ["create-linux-build", "create-windows-build"]
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Avalonia.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using ModularToolManager.Models.Messages;
using ModularToolManagerModel.Services.Functions;
using System;
Expand Down

0 comments on commit 064411e

Please sign in to comment.