-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Publish Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
PROJECT_PATH: dev/AlAnvar.csproj | ||
DIR_PATH: publish | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up NuGet | ||
run: | | ||
nuget sources add -name MyNuGetSource -source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json | ||
- name: Get TvTime Version | ||
uses: kzrnm/[email protected] | ||
id: get-version | ||
with: | ||
proj-path: ${{ env.PROJECT_PATH }} | ||
|
||
- name: Build and Publish TvTime | ||
run: dotnet publish ${{ env.PROJECT_PATH }} -c Release -r win10-x64 -p:Platform=x64 --self-contained true -p:PublishSingleFile=false -p:PublishReadyToRun=true -p:PublishTrimmed=false --output publish | ||
|
||
- name: Zip Publish Folder | ||
uses: vimtor/[email protected] | ||
with: | ||
files: ${{ env.DIR_PATH }} | ||
recursive: true | ||
dest: publish/TvTime-v${{steps.get-version.outputs.version-prefix}}.zip | ||
|
||
- name: Create Github Release | ||
uses: actions/[email protected] | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VersionName: v${{steps.get-version.outputs.version-prefix}} | ||
with: | ||
tag_name: ${{ env.VersionName }} | ||
release_name: ${{ env.VersionName }} | ||
|
||
- name: Upload Zip file to Github Release | ||
uses: csexton/release-asset-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
file: publish/TvTime-v${{steps.get-version.outputs.version-prefix}}.zip | ||
release-url: ${{ steps.create_release.outputs.upload_url }} | ||
|
||
changelog: | ||
needs: build | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get TvTime Version | ||
uses: kzrnm/[email protected] | ||
id: get-version | ||
with: | ||
proj-path: ${{ env.PROJECT_PATH }} | ||
|
||
- name: Install auto-changelog Package | ||
run: npm install -g auto-changelog | ||
|
||
- name: Generate CHANGELOG.md | ||
run: auto-changelog --commit-limit false --starting-version v${{steps.get-version.outputs.version-prefix}} --ending-version v${{steps.get-version.outputs.version-prefix}} --hide-credit | ||
|
||
- name: Get Latest Github Release | ||
id: latest_release | ||
uses: kaliber5/action-get-release@v1 | ||
with: | ||
token: ${{ github.token }} | ||
latest: true | ||
|
||
- name: Read CHANGELOG.md Content | ||
id: changelog | ||
uses: jaywcjlove/github-action-read-file@main | ||
with: | ||
localfile: CHANGELOG.md | ||
|
||
- name: Update Github Release with CHANGELOG.md | ||
uses: kaliber5/action-update-release@v1 | ||
with: | ||
token: ${{ github.token }} | ||
id: ${{ steps.latest_release.outputs.id }} | ||
body: ${{ steps.changelog.outputs.content }} |