From 22bb24471f1510815b7741a2befbf47a9ef056a7 Mon Sep 17 00:00:00 2001 From: zznty <94796179+zznty@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:07:42 +0300 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d1da7f..5385687 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: steps: - uses: actions/checkout@master with: + ref: ${{ github.head_ref }} fetch-depth: 0 - uses: actions/setup-dotnet@v3 @@ -22,8 +23,12 @@ jobs: - run: dotnet restore CringeLauncher/CringeLauncher.csproj --locked-mode name: Restore Project + + - name: Git Version + id: version + uses: codacy/git-version@2.7.1 - - run: dotnet publish -c Release -o ./pub CringeLauncher/CringeLauncher.csproj --no-restore /p:PackageVersion="${{ steps.version.outputs.version }}" /p:AssemblyVersion="${{ steps.version.outputs.version }}" + - run: dotnet publish -c Release -o ./pub CringeLauncher/CringeLauncher.csproj --no-restore -p:Version="${{ steps.version.outputs.version }}" id: publish name: Build Project @@ -33,7 +38,28 @@ jobs: working-directory: ./pub name: Zip Results - - uses: actions/upload-artifact@v3 + - name: Create Draft Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: launcher - path: pub.zip \ No newline at end of file + tag_name: ${{ steps.version.outputs.version }} + release_name: Launcher Release + draft: true + prerelease: false + + - uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./pub.zip + asset_name: CringeLauncher.zip + asset_content_type: application/zip + + - uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }}