Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
Automate Release Creation
Debugging GitHub Workflow Actions #1

Debugging GitHub Workflow Actions #2

Debugging GitHub Workflow Actions #3
Debugging GitHub Workflow Actions #4
Debugging GitHub Workflow Actions #5

Debugging GitHub Workflow Actions #6

Debugging GitHub Workflow Actions #7

Debugging GitHub Workflow Actions #8
Debugging GitHub Workflow Actions #9
Debugging GitHub Workflow Actions #10
Debugging GitHub Workflow Actions #11
Debugging GitHub Workflow Actions #12
Debugging GitHub Workflow Actions #13
Debugging GitHub Workflow Actions #14
Debugging GitHub Workflow Actions #14
Update main.yml

Debugging GitHub Workflow Actions #15
Debugging GitHub Workflow Actions #16
Debugging GitHub Workflow Actions #17
Debugging GitHub Workflow Actions #18
Debugging GitHub Workflow Actions #19
  • Loading branch information
Xorcist authored and Xorcist committed Jul 5, 2024
1 parent b8bb5d2 commit 46dcd55
Showing 1 changed file with 40 additions and 11 deletions.
51 changes: 40 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,59 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: Build + Release
runs-on: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup NuGet
uses: NuGet/setup-nuget@v1
uses: NuGet/setup-nuget@v2

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2

- name: Restore NuGet Packages
run: nuget restore Stateus.sln

- name: Build Solution
run: msbuild Stateus.sln /p:Configuration=Release

- name: Create Archive
run: Compress-Archive -Path ./bin/Release/* -Destination ./bin/Stateus_${{ github.ref_name }}.zip

- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Stateus_${{ github.ref_name }}
path: ./bin/Release

- name: Create Release
id: create_release
uses: actions/create-release@v1
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 }}
release_name: ${{ github.ref_name }} Release of Stateus
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Stateus_Artifact
path: bin\Release
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./bin/Stateus_${{ github.ref_name }}.zip
asset_name: Stateus_${{ github.ref_name }}.zip
asset_content_type: application/zip

0 comments on commit 46dcd55

Please sign in to comment.