Update publish.yml #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' # For releases | |
env: | |
SOLUTION_FILE_PATH: CRT.sln | |
BUILD_PLATFORM: x64 | |
BUILD_CONFIGURATION: Release | |
permissions: | |
contents: write # Required for creating releases | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- name: Restore NuGet packages | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: nuget restore ${{ env.SOLUTION_FILE_PATH }} | |
- name: Restore vcpkg packages | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: vcpkg integrate install | |
- name: Build | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} ${{ env.SOLUTION_FILE_PATH }} | |
- name: Copy oidn dll | |
run: cp ${{ github.workspace }}/libs/oidn/bin/*.dll ${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }} | |
- name: Upload binaries as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-binaries | |
path: | | |
${{ github.workspace }}/x64/${{ env.BUILD_CONFIGURATION }}/* | |
retention-days: 5 | |
release: | |
name: Create Release | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-binaries | |
path: ./binaries/build-binaries.zip # Path to the binaries directory | |
- name: Display structure of downloaded files | |
run: ls -R ./binaries | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
body: | | |
Changes in this Release | |
- First Change | |
- Second Change | |
draft: false | |
prerelease: false | |
- name: Zip before upload release asset | |
uses: TheDoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: '.\win64-binaries.zip' | |
path: '.\binaries\build-binaries.zip\*' | |
exclusions: '*.pdb' | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .\win64-binaries.zip | |
asset_name: win64-binaries.zip | |
asset_content_type: application/zip |