Update build.yml to upload artifacts #5
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: "Auto Deploy" | |
on: | |
push: | |
tags: | |
- "auto-deploy/v*" | |
env: | |
PROJECT_PATH: "Auto/Auto.csproj" | |
jobs: | |
deploy: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "9.0.x" | |
- name: Install dependencies | |
run: dotnet restore ${{ env.PROJECT_PATH }} | |
- name: Build | |
run: dotnet build ${{ env.PROJECT_PATH }} | |
- name: Build for release and Publish | |
run: dotnet publish ${{ env.PROJECT_PATH }} -c Release --self-contained -r win-x64 -p:PublishSingleFile=true -o publish | |
- name: Upload artifact | |
id: upload_artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Auto | |
path: .\publish | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
- uses: csexton/release-asset-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ steps.upload_artifact.artifact-url }} | |
release-url: ${{ steps.create_release.outputs.upload_url }} |