-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (51 loc) · 2.15 KB
/
publish.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
name: create-release
on:
workflow_dispatch:
env:
DOTNET_VERSION: '7.x'
OUTPUT_ARTIFACT_FILENAME: 'SteamAccountSwitcher_Win-x86.zip'
TAG_NAME: ${{ github.run_id }}-${{ github.run_number }}
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 🙉 Installing dependencies
run: dotnet restore
- name: 🛠️ Build
run: |
cd "SteamAccountManager.AvaloniaUI"
dotnet build --configuration Release
dotnet publish --self-contained -c Release -f "net7.0-windows10.0.17763.0" -o ../output -r win-x86 -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false
- name: Create Artifacts
run: |
7z a -tzip ${{ env.OUTPUT_ARTIFACT_FILENAME }} output/*
- name: 🔮 Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
path: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: SteamAccountSwitcher
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
asset_name: ${{ env.OUTPUT_ARTIFACT_FILENAME }}
asset_content_type: application/zip