-
Notifications
You must be signed in to change notification settings - Fork 33
97 lines (95 loc) · 3.98 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
inputs:
majorVersion:
required: true
default: '0'
minorVersion:
required: true
default: '1'
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: macos-latest
env:
releaseVersion: ${{ github.event.inputs.majorVersion }}.${{ github.event.inputs.minorVersion }}.${{ github.run_number }}
steps:
- name: Version
run: echo Releasing version $releaseVersion
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
# Publish osx-x64
- name: Publish osx-x64
run: dotnet publish -r osx-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip osx-x64
run: (cd PurpleExplorer/bin/Release/net6.0/osx-x64/publish ; zip -r PurpleExplorer_osx-x64.zip *)
# Publish osx-arm64
- name: Publish osx-arm64
run: dotnet publish -r osx-arm64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip osx-arm64
run: (cd PurpleExplorer/bin/Release/net6.0/osx-arm64/publish ; zip -r PurpleExplorer_osx-arm64.zip *)
# Publish win-x64
- name: Publish win-x64
run: dotnet publish -r win-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip win-x64
run: (cd PurpleExplorer/bin/Release/net6.0/win-x64/publish ; zip -r PurpleExplorer_win-x64 *)
# Publish linux-x64
- name: Publish linux-x64
run: dotnet publish -r linux-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip linux-x64
run: (cd PurpleExplorer/bin/Release/net6.0/linux-x64/publish ; zip -r PurpleExplorer_linux-x64 *)
# Create release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.releaseVersion }}
release_name: ${{ env.releaseVersion }}
draft: false
prerelease: false
# Upload osx-x64
- name: Upload osx-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PurpleExplorer/bin/Release/net6.0/osx-x64/publish/PurpleExplorer_osx-x64.zip
asset_name: PurpleExplorer_osx-x64.zip
asset_content_type: application/zip
# Upload osx-arm64
- name: Upload osx-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PurpleExplorer/bin/Release/net6.0/osx-arm64/publish/PurpleExplorer_osx-arm64.zip
asset_name: PurpleExplorer_osx-arm64.zip
asset_content_type: application/zip
# Upload win-x64
- name: Upload win-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PurpleExplorer/bin/Release/net6.0/win-x64/publish/PurpleExplorer_win-x64.zip
asset_name: PurpleExplorer_win-x64.zip
asset_content_type: application/zip
# Upload linux-x64
- name: Upload linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PurpleExplorer/bin/Release/net6.0/linux-x64/publish/PurpleExplorer_linux-x64.zip
asset_name: PurpleExplorer_linux-x64.zip
asset_content_type: application/zip