Skip to content

Commit

Permalink
Rework workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
winromulus committed Jun 15, 2024
1 parent 79f5836 commit 1577cb5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 56 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/ci.yaml

This file was deleted.

58 changes: 46 additions & 12 deletions .github/workflows/cd.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
name: CD
name: Main Workflow

on:
workflow_run:
workflows: ["CI"]
types:
- completed
push:
branches:
- '**' # Matches all branches
pull_request:

jobs:
deploy:
ci:
name: CI
runs-on: ubuntu-latest
needs: build-and-test
outputs:
src_changed: ${{ steps.src_changed.outputs.changes }}
steps:

- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: src - identify source changes
id: src_changed
uses: dorny/paths-filter@v3
with:
base: ${{ github.ref }}
filters: |
src:
- 'src/**'
solution:
- 'ES.FX.sln'
build:
- 'Directory.Build.props'
- name: build
uses: ./.github/actions/build
if: steps.src_changed.outputs.src == 'true'
with:
configuration: Debug
useVersioning: false

- name: test
if: steps.src_changed.outputs.src == 'true'
uses: ./.github/actions/test

cd:
name: CD
runs-on: ubuntu-latest
needs: ci
if: >
needs.build-and-test.outputs.src_changed == 'true' &&
needs.ci.outputs.src_changed == 'true' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
(github.ref == 'refs/heads/main' ||
Expand Down Expand Up @@ -56,12 +93,9 @@ jobs:
- name: dotnet nuget add source
shell: bash
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/emberstack/index.json"



- name: dotnet nuget push
run: |
for pkg in .artifacts/nuget/*.nupkg; do
dotnet nuget push "$pkg" --source "github" --api-key ${{ secrets.ES_GITHUB_PAT }}
done

0 comments on commit 1577cb5

Please sign in to comment.