Build and Release #117
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: Build and Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.csproj' | |
- 'Program.cs' | |
- 'icon.ico' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
platform: linux-x64 | |
- os: windows-latest | |
platform: win-x64 | |
- os: macos-latest | |
platform: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Project Version | |
id: version | |
run: echo "version=$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' ./metadata-extractor-cli.csproj)" >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Tag version | |
run: git tag ${{ env.version }} | |
- name: Push Tags | |
run: git push origin --tags | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Publish Single File Executable | |
run: dotnet publish -c Release -p:PublishSingleFile=true -p:DebugType=none -o ./publish/${{ matrix.platform }} | |
- name: Publish Single File Executable without .NET Runtime | |
run: dotnet publish -c Release -p:PublishSingleFile=true -p:SelfContained=false -p:DebugType=none -o ./publish/${{ matrix.platform }}-no-runtime | |
- name: List Publish Directory | |
run: ls -l ./publish | |
- name: Upload Default Executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-${{ matrix.platform }} | |
path: ./publish/${{ matrix.platform }} | |
- name: Upload Executable without .NET Runtime | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-${{ matrix.platform }}-no-runtime | |
path: ./publish/${{ matrix.platform }}-no-runtime | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Archives | |
uses: actions/download-artifact@v4 | |
- name: List downloaded files | |
run: ls -l | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.DYGNITORZ_TOKEN_OLD }} |