Repository navigation
84 lines (80 loc) · 2.71 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (80 loc) · 2.71 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
name: Package AI Client
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
version:
description: Release version (for example 1.0.0)
required: true
permissions:
contents: write
actions: write
jobs:
package:
strategy:
fail-fast: false
matrix:
include:
- runtime: win-x64
runner: windows-latest
- runtime: win-arm64
runner: windows-latest
- runtime: osx-x64
runner: macos-latest
- runtime: osx-arm64
runner: macos-latest
- runtime: linux-x64
runner: ubuntu-latest
- runtime: linux-arm64
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Install Windows packager
if: runner.os == 'Windows'
shell: pwsh
run: choco install innosetup --yes --no-progress
- name: Build installers
shell: pwsh
run: dotnet run --project ./build -- package-release --runtime "${{ matrix.runtime }}" --version "${{ inputs.version || github.ref_name }}"
- uses: actions/upload-artifact@v7
with:
name: installers-${{ matrix.runtime }}
path: artifacts/release/packages/*
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
needs: package
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
pattern: installers-*
path: artifacts/release-packages
merge-multiple: true
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
INPUT_VERSION: ${{ inputs.version }}
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
tag="$GITHUB_REF_NAME"
else
tag="v${INPUT_VERSION#v}"
fi
prerelease=false
if [[ "$tag" == *-* ]]; then prerelease=true; fi
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release upload "$tag" artifacts/release-packages/* --repo "$GITHUB_REPOSITORY" --clobber
gh release edit "$tag" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease"
else
gh release create "$tag" artifacts/release-packages/* --repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" --title "$tag" --generate-notes --prerelease="$prerelease"
fi
- name: Refresh public update catalog
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run pages.yml --repo "$GITHUB_REPOSITORY" --ref master