mirror of
https://github.com/ezhevita/YandexKeyExtractor
synced 2025-08-16 19:40:48 +07:00
96 lines
3.0 KiB
YAML
96 lines
3.0 KiB
YAML
name: .NET
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
DOTNET_SDK_VERSION: 6.0.x
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
|
|
- name: Publish generic
|
|
run: dotnet publish -c Release -o out/generic -p:UseAppHost=false
|
|
- name: Upload generic artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ github.event.repository.name }}
|
|
path: out/generic
|
|
- name: Publish Windows version
|
|
run: dotnet publish -c Release -o out/win -p:PublishSingleFile=true -p:PublishTrimmed=true -r win-x64
|
|
- name: Upload Windows artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ github.event.repository.name }}-Windows
|
|
path: out/win
|
|
|
|
release:
|
|
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Download generic artifacts
|
|
uses: actions/download-artifact@v4.1.0
|
|
with:
|
|
name: ${{ github.event.repository.name }}
|
|
path: out/${{ github.event.repository.name }}
|
|
|
|
- name: Download Windows artifacts
|
|
uses: actions/download-artifact@v4.1.0
|
|
with:
|
|
name: ${{ github.event.repository.name }}-Windows
|
|
path: out/${{ github.event.repository.name }}-Windows
|
|
|
|
- name: Archive generic release
|
|
uses: thedoctor0/zip-release@master
|
|
with:
|
|
directory: out
|
|
path: ${{ github.event.repository.name }}
|
|
type: 'zip'
|
|
filename: 'generic.zip'
|
|
exclusions: '*.json'
|
|
|
|
- name: Archive Windows release
|
|
uses: thedoctor0/zip-release@master
|
|
with:
|
|
directory: out
|
|
path: ${{ github.event.repository.name }}-Windows
|
|
type: 'zip'
|
|
filename: 'Windows.zip'
|
|
exclusions: '*.json'
|
|
|
|
- name: Create GitHub release
|
|
id: github_release
|
|
uses: actions/create-release@v1.1.4
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.event.repository.name }} V${{ github.ref }}
|
|
|
|
- name: Upload generic artifacts to GitHub release
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.github_release.outputs.upload_url }}
|
|
asset_path: out/generic.zip
|
|
asset_name: generic.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload Windows artifacts to GitHub release
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.github_release.outputs.upload_url }}
|
|
asset_path: out/Windows.zip
|
|
asset_name: Windows.zip
|
|
asset_content_type: application/zip
|