Skip to content

Commit

Permalink
Try to ZIP and upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelonken committed Jan 5, 2024
1 parent e7155ff commit d3884f4
Showing 1 changed file with 47 additions and 34 deletions.
81 changes: 47 additions & 34 deletions .github/workflows/cmake-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
with:
vs-version: '17'
msbuild-architecture: x64
- uses: actions/setup-python@v4
with:
python-version: '3.8.0'


# - name: Download prerequisite packages
# run: |
Expand Down Expand Up @@ -53,7 +57,7 @@ jobs:
echo "Step 2"
cd ${{ github.workspace }}\dcmtk-build
echo "Step 3"
cmake -G "Visual Studio 17 2022" -Ax64 -DITK_DIR:PATH=c:\ITK-install\lib\cmake\ITK-5.3 -DDCMTK_DIR:PATH=c:\DCMTK-install\cmake -DZLIB_ROOT:PATH=c:\zlib-install -DZLIB_INCLUDE_DIR:PATH=c:\zlib-install\include -DZLIB_LIBRARY:FILEPATH=c:\zlib-install\lib\zlib.lib -DBUILD_SHARED_LIBS:BOOL=OFF ${{ github.workspace }}
cmake -G "Visual Studio 17 2022" -Ax64 -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}\dcmtk-install ${{ github.workspace }}
- name: Build dcmtk
run: |
Expand All @@ -65,43 +69,52 @@ jobs:
cd ${{ github.workspace }}\dcmtk-build
ctest -VV -C Release --no-compress-output
- name: Package dcmtk
- name: Install dcmtk
run: |
cd ${{ github.workspace }}\dcmtk-build
cmake --build . --config Release --target INSTALL -- /m
- name: Put current date into a variable
run: |
$NOW=& Get-Date -format yyyy-MM-dd
echo "NOW=$NOW" >> $env:GITHUB_ENV
- uses: edgarrc/action-7z@v1
with:
args: 7z a ${{ github.workspace }}\dcmtk-build\dcmtk-install\dcmtk-build\dcmtk-${{ env.NOW }}-win64.zip ${{ github.workspace }}\dcmtk-install\*

- uses: actions/upload-artifact@v3
with:
name: dcmtk-build
path: ${{ github.workspace }}\dcmtk-build\dcmtk-*-win64*.zip

# publish-windows:

# runs-on: windows-latest
# timeout-minutes: 5
# # Only run if the event is not a pull request and the repository owner is QIICR.
# # The latter is to prevent forks from publishing packages even if the owner's token
# # would have sufficient privileges.
# if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}}

# needs: build-windows

# steps:
# - uses: actions/checkout@v3
# with:
# fetch-tags: true
# - uses: actions/download-artifact@v3
# with:
# name: dcmtk-build
# path: ${{ github.workspace }}\dcmtk-build\dcmtk-build

# - name: Publish package
# run: |
# pip install -U "scikit-ci-addons>=0.22.0"
# ci_addons publish_github_release qiicr/dcmqi `
# --exit-success-if-missing-token `
# --release-packages "${{ github.workspace }}\dcmtk-build\dcmtk-build\dcmqi-*-win64.zip" `
# --prerelease-packages "${{ github.workspace }}\dcmtk-build\dcmtk-build\dcmqi-*-win64-*.zip" `
# --prerelease-packages-clear-pattern "dcmqi-*-win64-*" `
# --prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" `
# --token ${{ secrets.GA_TOKEN }}
path: ${{ github.workspace }}\dcmtk-build\dcmtk-install\dcmtk-*-win64*.zip

publish-windows:

runs-on: windows-latest
timeout-minutes: 5
# Only run if the event is not a pull request and the repository owner is michaelonken.
# The latter is to prevent forks from publishing packages even if the owner's token
# would have sufficient privileges.
if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'michaelonken')}}

needs: build-windows

steps:
- uses: actions/checkout@v3
with:
fetch-tags: true
- uses: actions/download-artifact@v3
with:
name: dcmtk-build
path: ${{ github.workspace }}\dcmtk-build

- name: Publish package
run: |
pip install -U "scikit-ci-addons>=0.22.0"
ci_addons publish_github_release qiicr/dcmqi `
--exit-success-if-missing-token `
--release-packages "${{ github.workspace }}\dcmtk-build\dcmtk-build\dcmqi-*-win64.zip" `
--prerelease-packages "${{ github.workspace }}\dcmtk-build\dcmtk-build\dcmqi-*-win64-*.zip" `
--prerelease-packages-clear-pattern "dcmqi-*-win64-*" `
--prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" `
--token ${{ secrets.GA_TOKEN }}

0 comments on commit d3884f4

Please sign in to comment.