-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (80 loc) · 2.46 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
name: Release
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.gitignore'
- '.editorconfig'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nuget:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
- name: Install dotnet-script
run: |
dotnet tool install -g dotnet-script
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Build Release
run: dotnet build Reown.NoUnity.slnf -c Release --restore
- name: Pack nugets
run: dotnet pack Reown.NoUnity.slnf -c Release --no-build --output .
- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
**/bin/**/*.dll
!**/test/**/bin/**/*.dll
unity:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
- name: Install dotnet-script
run: |
dotnet tool install -g dotnet-script
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Configure Git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Create git tags
run: |
set -e
VERSION=$(dotnet-script ./.github/scripts/get-version.csx)
if [ -z "$VERSION" ]; then
echo "Error: Version script returned empty value"
exit 1
fi
echo "Creating tags for version $VERSION"
dotnet-script ./.github/scripts/get-unity-package-names.csx | while read -r package; do
TAG="$package/$VERSION"
echo "Creating tag $TAG"
git tag -a "$TAG" -m "Release $package version $VERSION"
done
- name: Push tags
run: git push origin --tags