Publish Release / Package #28
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
# This is a basic workflow to help you get started with Actions | |
name: Publish Release / Package | |
# Controls when the action will run. | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Restore dependencies | |
run: dotnet restore "src\Onbox.TypeSharp\Onbox.TypeSharp.csproj" | |
- name: Build and Publish | |
run: dotnet publish "src\Onbox.TypeSharp\Onbox.TypeSharp.csproj" -c Release | |
- name: Zip Release | |
uses: papeloto/action-zip@v1 | |
with: | |
files: src\Onbox.TypeSharp\bin\Release\net5.0\win-x86\publish | |
dest: release.zip | |
- name: Create Release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: actionRelease | |
release_name: Release actionRelease | |
draft: true | |
prerelease: false | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
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: ./release.zip | |
asset_name: release.zip | |
asset_content_type: application/zip | |
id: upload-release-asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Nuget pack | |
run: nuget pack "src\Onbox.TypeSharp\Onbox.TypeSharp.nuspec" -OutputDirectory "${{env.GITHUB_WORKSPACE}}\src\Onbox.TypeSharp" | |
- name: Nuget publish | |
run: nuget push "${{env.GITHUB_WORKSPACE}}\src\Onbox.TypeSharp\*.nupkg" -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} | |