|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + branches: [main, develop] |
| 7 | + types: [opened, synchronize, ready_for_review] |
| 8 | + |
| 9 | +# cancel running actions for current PR if new commits were pushed |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + check-changelog: |
| 16 | + name: check CHANGELOG.md |
| 17 | + if: github.event.pull_request.draft == false |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: Get changed files |
| 25 | + id: changed-files |
| 26 | + uses: tj-actions/changed-files@v37 |
| 27 | + |
| 28 | + - name: Check if changelog was touched |
| 29 | + run: | |
| 30 | + changelogFound=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | grep -ow "CHANGELOG.md" | wc -w) |
| 31 | + if [ $changelogFound -eq 0 ]; then |
| 32 | + echo '### :boom: Please update the changelog accordingly (https://keepachangelog.com)' >> $GITHUB_STEP_SUMMARY |
| 33 | + exit 1 |
| 34 | + fi |
| 35 | +
|
| 36 | + dotnet-build: |
| 37 | + name: dotnet build and pack |
| 38 | + if: github.event.pull_request.draft == false |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v3 |
| 42 | + |
| 43 | + - uses: actions/setup-dotnet@v3 |
| 44 | + with: |
| 45 | + dotnet-version: 6.x |
| 46 | + |
| 47 | + - run: dotnet build -c Release |
| 48 | + |
| 49 | + - run: dotnet pack -c Release --no-build --no-restore -o ./artifacts |
| 50 | + |
| 51 | + - run: mv ./artifacts/*.nupkg ./artifacts/Neolution.Extensions.Configuration.GoogleSecrets.${{ github.run_id }}-${{ github.run_attempt }}.nupkg |
| 52 | + |
| 53 | + - name: Upload artifact |
| 54 | + uses: actions/upload-artifact@v3 |
| 55 | + with: |
| 56 | + name: "nuget-package" |
| 57 | + path: ./artifacts/*.nupkg |
0 commit comments