Skip to content

Commit

Permalink
feat: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aamiaa committed Dec 21, 2024
1 parent 2e70bc2 commit c1fc496
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
tags: ["*"]

jobs:
build:
runs-on: windows-latest

outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set version
id: set-version
uses: actions/github-script@v7
with:
script: return context.ref.split("/")[2]
result-encoding: string

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Publish
run: dotnet publish -p:PublishSingleFile=true -p:Version=${{ steps.set-version.outputs.result }} -r win-x64 -c Release --no-self-contained

- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: Data-Package-Tool-v${{ steps.set-version.outputs.result }}-${{ github.sha }}
path: .\src\bin\Release\net6.0-windows\win-x64\publish\*

- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ./src/bin/Release/net6.0-windows/win-x64/publish/Data-Package-Tool.exe
name: Data Package Tool v${{ steps.set-version.outputs.result }}
token: ${{ secrets.ACCESS_TOKEN }}

0 comments on commit c1fc496

Please sign in to comment.