Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
label: 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
121 changes: 121 additions & 0 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Release

on:
release:
types: [published]

jobs:
buildlinux:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Restore Nuget Packages
run: dotnet restore FileFormatConversion.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileFormatConversion.sln --configuration Release

#- name: Publish Images to Docker Hub - Pre Release
# if: ${{ github.event.release.prerelease == true }}
# run: |
# docker build . --file TransactionProcessor/Dockerfile --tag stuartferguson/transactionprocessor:dev
# docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
# docker push stuartferguson/transactionprocessor:dev

#- name: Publish Images to Docker Hub - Formal Release
# if: ${{ github.event.release.prerelease == false }}
# run: |
# docker build . --file TransactionProcessor/Dockerfile --tag stuartferguson/transactionprocessor:latest
# docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
# docker push stuartferguson/transactionprocessor:latest

- name: Publish API
if: ${{ github.event.release.prerelease == false }}
run: dotnet publish "FileFormatConversion\FileFormatConversion.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained

- name: Build Release Package
run: |
cd /home/runner/work/FileFormatConversion/FileFormatConversion/publishOutput
zip -r ../fileformatconversion.zip ./*

- name: Upload the artifact
uses: actions/upload-artifact@v4.4.0
with:
name: fileformatconversion
path: fileformatconversion.zip

deploystaging:
runs-on: stagingserver
needs: buildlinux
environment: staging
name: "Deploy to Staging"

steps:
- name: Download the artifact
uses: actions/download-artifact@v4.1.8
with:
name: fileformatconversion

- name: Remove existing Windows service
run: |
$serviceName = "Transaction Processing - File Format Conversion"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}

- name: Unzip the files
run: |
Expand-Archive -Path fileformatconversion.zip -DestinationPath "C:\txnproc\transactionprocessing\fileformatconversion" -Force

- name: Install as a Windows service
run: |
$serviceName = "Transaction Processing - File Format Conversion"
$servicePath = "C:\txnproc\transactionprocessing\fileformatconversion\FileFormatConversion.exe"

New-Service -Name $serviceName -BinaryPathName $servicePath -Description "Transaction Processing - File Format Conversion" -DisplayName "Transaction Processing - File Format Conversion" -StartupType Automatic
Start-Service -Name $serviceName

deployproduction:
runs-on: productionserver
needs: [buildlinux, deploystaging]
environment: production
name: "Deploy to Production"

steps:
- name: Download the artifact
uses: actions/download-artifact@v4.1.8
with:
name: fileformatconversion

- name: Remove existing Windows service
run: |
$serviceName = "Transaction Processing - File Format Conversion"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}

- name: Unzip the files
run: |
Expand-Archive -Path fileformatconversion.zip -DestinationPath "C:\txnproc\transactionprocessing\fileformatconversion" -Force

- name: Install as a Windows service
run: |
$serviceName = "Transaction Processing - File Format Conversion"
$servicePath = "C:\txnproc\transactionprocessing\fileformatconversion\FileFormatConversion.exe"

New-Service -Name $serviceName -BinaryPathName $servicePath -Description "Transaction Processing - File Format Conversion" -DisplayName "Transaction Processing - File Format Conversion" -StartupType Automatic
Start-Service -Name $serviceName
47 changes: 47 additions & 0 deletions .github/workflows/prlinked.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Move Linked Issues

on:
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
get-date:
runs-on: ubuntu-latest
outputs:
project_name_prefix: ${{ steps.format_date.outputs.formatted_date }}
steps:
- name: Get PR creation date
id: format_date
run: |
# Extract the month and year from the PR creation date
PR_DATE="${{ github.event.pull_request.created_at }}"
FORMATTED_DATE=$(date -d "$PR_DATE" "+%B %Y") # Format to Month Year

# Debugging: print out the formatted date
echo "Formatted Date: ${FORMATTED_DATE} Sprint"

# Set output using the Environment File method
echo "formatted_date=${FORMATTED_DATE} Sprint" >> $GITHUB_OUTPUT # Set the output for later jobs

debug-date:
needs: get-date
runs-on: ubuntu-latest
steps:
- name: Debug the outputs
run: |
echo "PR Number: ${{ github.event.pull_request.number }}"
echo "Project Column Name: Review"
echo "Project Name Prefix (from get-date job output): ${{ needs.get-date.outputs.project_name_prefix }}" # Access the output correctly

move-issues:
needs: get-date
uses: TransactionProcessing/org-ci-workflows/.github/workflows/move-linked-issue.yml@main
with:
pr_number: ${{ github.event.pull_request.number }}
project_column_name: "Review"
project_name_prefix: ${{ needs.get-date.outputs.project_name_prefix }} # Access the output from get-date job
secrets:
gh_token: ${{ secrets.GH_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Test Pull Requests

on:
pull_request:
branches:
- main

jobs:
build:
name: "Build and Test Pull Requests"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4

- name: Restore Nuget Packages
run: dotnet restore FileFormatConversion.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileFormatConversion.sln --configuration Release

#- name: Build Docker Image
# run: docker build . --file TransactionProcessor/Dockerfile --tag transactionprocessor:latest

#- name: Run Integration Tests
# run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj" --filter Category=PRTest --logger "trx;LogFileName=test-results.trx"

- uses: actions/upload-artifact@v4.4.0
if: ${{ failure() }}
with:
name: tracelogs
path: /home/txnproc/trace/
16 changes: 16 additions & 0 deletions .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Management

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.12.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/repository_maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Maintenance Tasks

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # This schedule runs the workflow at midnight every day

jobs:
cleanup-stale-branches:
runs-on: ubuntu-latest
steps:
- name: Cleanup Stale Branches
uses: cbrgm/cleanup-stale-branches-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
last-commit-age-days: 60
dry-run: false
rate-limit: true
9 changes: 9 additions & 0 deletions .github/workflows/use_central_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Move Task on PR Assignment
on:
pull_request:
types: [assigned]

jobs:
move_task:
uses: TransactionProcessing/org-ci-workflows/.github/workflows/move_task.yml@main
secrets: inherit
25 changes: 25 additions & 0 deletions FileFormatConversion.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36109.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileFormatConversion", "FileFormatConversion\FileFormatConversion.csproj", "{A07E7D02-0D79-472D-A5CF-784251BED2CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A07E7D02-0D79-472D-A5CF-784251BED2CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A07E7D02-0D79-472D-A5CF-784251BED2CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A07E7D02-0D79-472D-A5CF-784251BED2CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A07E7D02-0D79-472D-A5CF-784251BED2CA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9D7FCEE5-F6C9-4738-BBDF-3C2E470F80C2}
EndGlobalSection
EndGlobal
Loading
Loading