Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sevensolutions committed Oct 4, 2024
1 parent 328b3e4 commit 00f5fd1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ jobs:
with:
dotnet-version: 8.0.x

# Extract and publish version
- name: extract version
run: |
Get-Content "./src/NomadIIS/PluginInfo.cs" | Select-String 'public static readonly string Version = "([0-9]+\.[0-9]+\.[0-9])";' | ForEach-Object {
$version = $_.Matches[0].Groups[1].Value
}
$version | Out-File -Path version -NoNewline
- name: Upload version
if: ${{ matrix.profile.artifactName == 'nomad_iis' }} # We only need to do this once
uses: actions/upload-artifact@v4
with:
name: version
path: ./version

# Publish the application
- name: Publish the application
run: dotnet publish "./src/NomadIIS/NomadIIS.csproj" /p:PublishProfile="./src/NomadIIS/Properties/PublishProfiles/${{ matrix.profile.publishProfile }}"
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:

steps:
# Download artifacts
- uses: actions/download-artifact@master
with:
name: version
path: version
github-token: ${{ github.token }}
run-id: ${{ github.event.inputs.runId }}
- uses: actions/download-artifact@master
with:
name: nomad_iis
Expand All @@ -29,6 +35,13 @@ jobs:
github-token: ${{ github.token }}
run-id: ${{ github.event.inputs.runId }}

# Read version
- name: read version
run: |
$version = Get-Content .\version -Raw
Write-Host 'Version: ${version}'
echo "VERSION=${version}" >> $env:GITHUB_ENV
# Zip the artifacts
- uses: vimtor/action-zip@v1.2
with:
Expand All @@ -43,8 +56,8 @@ jobs:
- name: create release
uses: softprops/action-gh-release@v2
with:
name: vTODO
tag_name: vTODO
name: v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
draft: true
files: |
nomad_iis.zip
Expand Down

0 comments on commit 00f5fd1

Please sign in to comment.