Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hootanht/PersianDate
Browse files Browse the repository at this point in the history
  • Loading branch information
hootanht committed Sep 12, 2024
2 parents 3dd662a + 27aa971 commit 4a57ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
push:
branches:
- 'master' # Run the workflow when pushing to the master branch
tags: # Run the workflow when pushing to tags
- '*'
pull_request: # Run the workflow on pull requests

env:
Expand Down Expand Up @@ -74,7 +76,7 @@ jobs:
run: dotnet test --configuration Release

deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
runs-on: macos-latest
needs: [ validate_nuget, run_test ]
steps:
Expand Down Expand Up @@ -109,7 +111,7 @@ jobs:
}
create_github_release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
runs-on: macos-latest
needs: [ deploy ]
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The CI pipeline is now integrated into the CD pipeline and is defined in `.githu

## CD Pipeline

The CD pipeline is defined in `.github/workflows/CD.yml` and uses `macos-latest` as the VM image. It includes steps for creating, validating, testing, and deploying the NuGet package. The pipeline handles manual triggers, pull requests, and releases. It uses environment variables for the NuGet directory and the latest versions of GitHub Actions for checkout, setup-dotnet, and upload-artifact. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks. Additionally, it includes a step to delete existing tags if they already exist before creating a new release to avoid the 'Validation Failed: already_exists' error. The step now handles the case where the tag deletion fails and ensures the deletion step successfully removes the existing tag before proceeding to create a new release. The `fetch_changes` step now uses `pwsh` syntax: `$PREV_TAG = $(git describe --tags --abbrev=0 HEAD^)`.
The CD pipeline is defined in `.github/workflows/CD.yml` and uses `macos-latest` as the VM image. It includes steps for creating, validating, testing, and deploying the NuGet package. The pipeline handles manual triggers, pull requests, and releases. It uses environment variables for the NuGet directory and the latest versions of GitHub Actions for checkout, setup-dotnet, and upload-artifact. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks. Additionally, it includes a step to delete existing tags if they already exist before creating a new release to avoid the 'Validation Failed: already_exists' error. The step now handles the case where the tag deletion fails and ensures the deletion step successfully removes the existing tag before proceeding to create a new release. The `fetch_changes` step now uses `pwsh` syntax: `$PREV_TAG = $(git describe --tags --abbrev=0 HEAD^)`. The pipeline now also triggers on `push` to `tags`.

## Requirements

Expand Down

0 comments on commit 4a57ec5

Please sign in to comment.