Skip to content

Commit

Permalink
Merge pull request #134 from ministryofjustice/hotfix/revert-build
Browse files Browse the repository at this point in the history
revert changes to build that don't work correctly.
  • Loading branch information
yqi88i authored Aug 14, 2024
2 parents 1a5d65b + f0e5b91 commit b720fbe
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,23 @@ jobs:

# Publish the build artifacts
- name: Publish
run: dotnet publish --no-build --configuration Release --output ./publish
run: dotnet publish --configuration Release --no-build --output ./publish

# Run EF migrations
- name: Run EF migrations
run: dotnet ef migrations script --no-build --configuration Release --project src/Migrators/Migrators.MSSQL/Migrators.MSSQL.csproj --startup-project src/Server.UI/Server.UI.csproj --context Cfo.Cats.Infrastructure.Persistence.ApplicationDbContext --idempotent -o ./publish/Migration.sql
run: dotnet ef migrations script --project src/Migrators/Migrators.MSSQL/Migrators.MSSQL.csproj --startup-project src/Server.UI/Server.UI.csproj --no-build --context Cfo.Cats.Infrastructure.Persistence.ApplicationDbContext --idempotent -o ./publish/Migration.sql

# Compress the build artifacts into a ZIP file
- name: Compress build artifacts
run: |
cd publish
zip -r ../build-artifacts.zip .
# Read and increment version number
- name: Increment Version
id: increment_version
run: |
# Read the current version from the GitHub secret
CURRENT_VERSION=${{ secrets.INITIAL_VERSION }}
# Split the version into major, minor, and patch
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
# Increment the patch version
PATCH=$((PATCH + 1))
# Form the new version
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
# Set the new version as an environment variable
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
# Generate tag and release names based on the new version
# Generate tag and release names based on date
- name: Set Release Version
id: set_release_version
run: |
TAG_NAME="v${{ env.NEW_VERSION }}"
TAG_NAME="v$(date +'%Y%m%d%H%M%S')"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo "RELEASE_NAME=Release $TAG_NAME" >> $GITHUB_ENV
Expand All @@ -95,7 +73,7 @@ jobs:
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_NAME }}
body: 'Automatic release with incremented version number.'
body: 'Automatic release based on date and time.'
draft: false
prerelease: false

Expand Down

0 comments on commit b720fbe

Please sign in to comment.