Skip to content

Commit

Permalink
Use commit hash in prerelease filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelonken committed Jan 5, 2024
1 parent 10bb663 commit 9ed6b2a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/cmake-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
run: |
$NOW=& Get-Date -format yyyy-MM-dd
echo "NOW=$NOW" >> $env:GITHUB_ENV
git_hash=$(git rev-parse --short "$GITHUB_SHA")
echo "COMMIT_SHORT_SHA=$git_hash" >> $env:GITHUB_ENV
- name: Configure project

Expand All @@ -62,7 +64,7 @@ jobs:
echo "Step 2"
cd ${{ github.workspace }}\dcmtk-build
echo "Step 3"
cmake -G "Visual Studio 17 2022" -Ax64 -DDCMTK_MODULES:STR="ofstd;oflog;oficonv;dcmdata" -DDCMTK_ENABLE_BUILTIN_OFICONV_DATA:BOOL=On -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}\dcmtk-${{ env.NOW }} ${{ github.workspace }}
cmake -G "Visual Studio 17 2022" -Ax64 -DDCMTK_MODULES:STR="ofstd;oflog;oficonv;dcmdata" -DDCMTK_ENABLE_BUILTIN_OFICONV_DATA:BOOL=On -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}\dcmtk-${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }} ${{ github.workspace }}
- name: Build dcmtk
run: |
Expand All @@ -78,14 +80,14 @@ jobs:
run: |
cd ${{ github.workspace }}\dcmtk-build
cmake --build . --config Release --target INSTALL -- /m
Compress-Archive -Path ${{ github.workspace }}\dcmtk-${{ env.NOW }} -Destination ${{ github.workspace }}\dcmtk-${{ env.NOW }}\dcmtk-${{ env.NOW }}-win64.zip
Compress-Archive -Path ${{ github.workspace }}\dcmtk-${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }} -Destination ${{ github.workspace }}\dcmtk-${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }}\dcmtk-${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }}-win64.zip
echo "Listing install dir: ${{ github.workspace }}\dcmtk-${{ env.NOW }}"
ls ${{ github.workspace }}\dcmtk-${{ env.NOW }}
- uses: actions/upload-artifact@v3
with:
name: dcmtk-install-zip-package
path: ${{ github.workspace }}\dcmtk-${{ env.NOW }}\dcmtk-*-win64.zip
path: ${{ github.workspace }}\dcmtk-${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }}\dcmtk-*-win64.zip

publish-windows:

Expand All @@ -108,6 +110,7 @@ jobs:
path: ${{ github.workspace }}\dcmtk-install


# prerelease-packages-clean-pattern is still missing
- name: Publish package
run: |
echo "Listing install dir: ${{ github.workspace }}\dcmtk-install"
Expand All @@ -117,5 +120,5 @@ jobs:
--exit-success-if-missing-token `
--release-packages "${{ github.workspace }}\dcmtk-install\dcmtk-*-win64*.zip" `
--prerelease-packages "${{ github.workspace }}\dcmtk-install\dcmtk-*-win64*.zip" `
--prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" `
--prerelease-packages-keep-pattern "*${{ env.NOW }}-${{ env.COMMIT_SHORT_SHA }}*" `
--token ${{ secrets.PUBLISH_RELEASE_TOKEN }}

0 comments on commit 9ed6b2a

Please sign in to comment.