Skip to content

Commit

Permalink
chore: Rename workflow file to ci.yml and split to ci and publish par…
Browse files Browse the repository at this point in the history
…ts (#59)

Split workflow file into ci and publish parts.
  • Loading branch information
Puchaczov authored Jul 9, 2024
1 parent c20bfe7 commit 4c1532d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/dotnetcore.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Publish
name: CI

on:
push:
branches:
- '**'
paths-ignore:
- 'badges/**'

Expand Down Expand Up @@ -95,17 +97,3 @@ jobs:
else
echo "No changes to commit"
fi
- name: Publish
if: github.ref == 'refs/heads/master'
run: |
$scriptLocationDirectory=(Get-Location).ToString()
$scriptLocationFilePath=[System.IO.Path]::Combine($scriptLocationDirectory, "Publish.Nuget.ps1")
$nugetExecutable=[System.IO.Path]::Combine($scriptLocationDirectory, "nuget", "nuget.exe")
$projects = @('Musoq.Converter', 'Musoq.Evaluator', 'Musoq.Parser', 'Musoq.Plugins', 'Musoq.Schema')
foreach ($project in $projects) {
pushd
cd "./$project/bin/Release"
Invoke-Expression "$scriptLocationFilePath $nugetExecutable $project '${{ secrets.nuget_musoq_key }}'"
popd
}
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
workflow_dispatch:

workflow_run:
workflows: ["CI"]
types:
- completed

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
dotnet-version: '8.0.x'
- name: Publish
run: |
$scriptLocationDirectory=(Get-Location).ToString()
$scriptLocationFilePath=[System.IO.Path]::Combine($scriptLocationDirectory, "Publish.Nuget.ps1")
$nugetExecutable=[System.IO.Path]::Combine($scriptLocationDirectory, "nuget", "nuget.exe")
$projects = @('Musoq.Converter', 'Musoq.Evaluator', 'Musoq.Parser', 'Musoq.Plugins', 'Musoq.Schema')
foreach ($project in $projects) {
pushd
cd "./$project/bin/Release"
Invoke-Expression "$scriptLocationFilePath $nugetExecutable $project '${{ secrets.nuget_musoq_key }}'"
popd
}

0 comments on commit 4c1532d

Please sign in to comment.