Release #13
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: Release | |
| env: | |
| ProjectName: Osu-player | |
| on: | |
| create: | |
| tags: | |
| - "*.*.*" | |
| jobs: | |
| build: | |
| name: Build and Release | |
| if: ${{ StartsWith(github.ref, 'refs/tags/') }} | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Secrets | |
| if: ${{ success() }} | |
| shell: pwsh | |
| run: | | |
| echo 'namespace Milky.OsuPlayer.Sentry{public static partial class SentryNLog{ private static string __dsn ="${{ secrets.SENTRY_DSN }}";}}'>OsuPlayer.Sentry/SentryNLog.Secret.cs | |
| - name: Publish | |
| if: ${{ success() }} | |
| run: | | |
| echo ${{ github.ref }} | |
| dotnet publish OsuPlayer.Wpf --no-restore --framework net5.0-windows --runtime win-x64 --self-contained --configuration Release --output ci-publish | |
| - name: Confuser | |
| if: ${{ success() }} | |
| shell: pwsh | |
| run: | | |
| mkdir ConfuserEx -Force | |
| Invoke-WebRequest https://github.com/mkaring/ConfuserEx/releases/download/v1.5.0/ConfuserEx-CLI.zip -OutFile "ConfuserEx/cli.zip" | |
| 7z x "ConfuserEx/cli.zip" -oConfuserEx/ | |
| copy .\OsuPlayer.Sentry\Confuse.crproj . | |
| .\ConfuserEx\Confuser.CLI.exe Confuse.crproj -n | |
| del .\ci-publish\OsuPlayer.Sentry.pdb -Force | |
| - name: Get tag | |
| uses: dawidd6/action-get-tag@v1 | |
| if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
| id: tag | |
| - name: Pack via 7z | |
| if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
| run: | | |
| mkdir -p ./ci-pack/ | |
| 7z a -mx9 -mfb=273 -ms -md=31 -myx=9 -mtm=- -mmt -mmtf -md=1536m -mmf=bt3 -mmc=10000 -mpb=0 -mlc=0 "./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}.7z" "./ci-publish/*" -x!"${{ env.ProjectName }}" -r | |
| - name: Create a new GitHub release if a new tag is pushed | |
| uses: softprops/action-gh-release@v1 | |
| if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| with: | |
| name: ${{ env.ProjectName }}-${{ steps.tag.outputs.tag }} | |
| prerelease: true | |
| draft: false | |
| files: | | |
| ./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}.7z |