Update Readme.md #776
This file contains hidden or 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 Program | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| BuildBranch: | |
| description: 'The branch you want to build.' | |
| required: true | |
| default: 'master' | |
| BuildConfiguration: | |
| description: 'The configuration for dotnet build.' | |
| required: true | |
| default: 'Release' | |
| type: choice | |
| options: | |
| - Release | |
| - Debug | |
| env: | |
| Configuration: ${{ github.event.inputs.BuildConfiguration || 'Release' }} | |
| Branch: ${{ github.event.inputs.BuildBranch || github.ref_name }} | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Get current time | |
| uses: josStorer/get-current-time@v2 | |
| id: current-time | |
| with: | |
| format: YYYYMMDDHHMMSS | |
| utcOffset: "+08:00" | |
| - uses: benjlevesque/[email protected] | |
| id: short-sha | |
| with: | |
| length: 6 | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ env.Branch }} | |
| submodules: recursive | |
| - name: Setup .NET8 | |
| uses: actions/[email protected] | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: get-version-action | |
| id: project-version | |
| uses: euberdeveloper/ga-project-version@main | |
| with: | |
| path: .\OngekiFumenEditor\version.json | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Publish | |
| run: dotnet publish .\OngekiFumenEditor\OngekiFumenEditor.csproj --no-restore -c ${{env.Configuration}} -o C:\ogkrEditorBuild\ | |
| - name: Delete unused .xml files | |
| run: Remove-Item -Path "C:\ogkrEditorBuild\*.xml" -Force | |
| - name: Delete unused runtime subfolders | |
| shell: pwsh | |
| run: | | |
| $runtimePath = "C:\ogkrEditorBuild\runtimes" | |
| Get-ChildItem -Path $runtimePath -Directory | | |
| Where-Object { $_.Name -ne "win-x64" } | | |
| Remove-Item -Recurse -Force | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: OngekiFumenEditor_${{env.GitBuildVersion}}_${{env.Branch}}_(GABuild${{ steps.current-time.outputs.formattedTime }}_${{ steps.short-sha.outputs.sha }}_${{env.Configuration}}) | |
| path: C:\ogkrEditorBuild\ | |