forked from Team-Resurgent/Repackinator
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 3.38 KB
/
dotnet.yml
File metadata and controls
98 lines (85 loc) · 3.38 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: BuildRepackinator
on:
push:
branches: [ "main", "workflow" ]
pull_request:
branches: [ "main", "workflow" ]
workflow_dispatch: {}
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os_flavor: [win-x64, linux-x64, osx-x64, osx-arm64]
project: [Repackinator]
project_lowercase: [repackinator]
include:
- os_flavor: win-x64
arch: x64
archive_ext: zip
- os_flavor: linux-x64
arch: x64
archive_ext: tar
- os_flavor: osx-x64
arch: x64
archive_ext: tar
- os_flavor: osx-arm64
arch: arm64
archive_ext: tar
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish ./${{ matrix.project }}/${{ matrix.project }}.csproj -p:Platform=${{ matrix.arch }} -r ${{ matrix.os_flavor }} -c Release -p:SelfContained=true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:TrimUnusedDependencies=false -p:DebugType=None -p:DebugSymbols=false -p:AvaloniaUseCompiledBindingsByDefault=true --output ${{ github.workspace }}/artifacts/${{ matrix.project }}/${{ matrix.os_flavor }}-${{ matrix.arch }} -maxcpucount:1
- name: Check publish output
run: ls -laR ${{ github.workspace }}/artifacts/${{ matrix.project }}/
- name: Chmod (Unix)
if: ${{ matrix.os_flavor == 'linux-x64' || matrix.os_flavor == 'osx-x64' || matrix.os_flavor == 'osx-arm64'}}
run: chmod +x ${{ github.workspace }}/artifacts/${{ matrix.project }}/${{ matrix.os_flavor }}-${{ matrix.arch }}/${{ matrix.project_lowercase }}
- name: Compress binaries
run: 7z a ${{ github.workspace }}/${{ matrix.project }}-${{ matrix.os_flavor }}.${{ matrix.archive_ext }} ${{ github.workspace }}/artifacts/${{ matrix.project }}/${{ matrix.os_flavor }}-${{ matrix.arch }}/*
- name: List directories and files
run: find .
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ matrix.os_flavor }}
path: ${{ github.workspace }}/${{ matrix.project }}-${{ matrix.os_flavor }}.${{ matrix.archive_ext }}
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
id: artifacts
with:
path: pipeline/build/artifacts
merge-multiple: true
- name: List Files
run: |
ls -la ${{ steps.artifacts.outputs.download-path }}
- name: Create draft Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: latest
draft: true
files: |
${{ github.workspace }}/Repackinator.nfo
${{ github.workspace }}/README.md
${{ steps.artifacts.outputs.download-path }}/*
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ github.workspace }}/Repackinator.nfo
${{ github.workspace }}/README.md
${{ steps.artifacts.outputs.download-path }}/*