-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (60 loc) · 2.14 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (60 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Release tag to upload assets to
required: true
permissions:
contents: write
env:
DOTNET_VERSION: '10.x'
CONFIGURATION: Release
PROJECT_PATH: EveAssetExtractor.csproj
APP_NAME: EveAssetExtractor
jobs:
build:
name: Build ${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- rid: win-x64
os: windows-latest
- rid: win-arm64
os: windows-latest
- rid: linux-x64
os: ubuntu-latest
- rid: linux-arm64
os: ubuntu-latest
- rid: osx-x64
os: macos-latest
- rid: osx-arm64
os: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish
run: dotnet publish ${{ env.PROJECT_PATH }} -c ${{ env.CONFIGURATION }} -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -o out
- name: Rename binary (Windows)
if: startsWith(matrix.rid, 'win')
shell: pwsh
run: Rename-Item "out/${{ env.APP_NAME }}.exe" "${{ env.APP_NAME }}-${{ matrix.rid }}.exe"
- name: Rename binary (non-Windows)
if: "!startsWith(matrix.rid, 'win')"
run: mv "out/${{ env.APP_NAME }}" "out/${{ env.APP_NAME }}-${{ matrix.rid }}"
- name: Upload to release (Windows)
if: startsWith(matrix.rid, 'win')
run: gh release upload "${{ github.event.release.tag_name || inputs.tag }}" "out/${{ env.APP_NAME }}-${{ matrix.rid }}.exe" --clobber --repo "${{ github.repository }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release (non-Windows)
if: "!startsWith(matrix.rid, 'win')"
run: gh release upload "${{ github.event.release.tag_name || inputs.tag }}" "out/${{ env.APP_NAME }}-${{ matrix.rid }}" --clobber --repo "${{ github.repository }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}