-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (88 loc) · 2.85 KB
/
main.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
98
99
100
101
102
103
104
105
106
name: Build and Publish
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish packages'
type: boolean
required: false
default: false
push:
jobs:
build:
runs-on: ubuntu-latest
env:
CONFIGURATION: Release
ISPUBLIC: 0
LATEST: 0
steps:
- if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: echo "ISPUBLIC=1" >> $GITHUB_ENV
- if: ${{ github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/') }}
run: echo "ISPUBLIC=1" >> $GITHUB_ENV
- if: ${{ github.ref == 'refs/heads/master' }}
run: echo "LATEST=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: source
- uses: actions/setup-dotnet@v4
with:
global-json-file: source/global.json
# - uses: dotnet/nbgv@master
# with:
# setAllVars: true
# path: source
- name: dependencies
working-directory: source
run: |
mkdir -p lib
pushd lib
curl -fSL --output deps.zip https://files.spoiledcat.com/deps.zip
7z -y -bb3 x deps.zip
popd
- run: dotnet --list-sdks
working-directory: source
- run: node --version
working-directory: source
- run: npm --version
working-directory: source
- run: for i in 1 2 3 4 5; do dotnet restore -v Minimal && break || sleep 1; done
working-directory: source
- run: ./build.sh -c $CONFIGURATION --ispublic $ISPUBLIC --trace
working-directory: source
- name: SpoiledBot
id: token
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.SPOILEDBOT_ID }}
private_key: ${{ secrets.SPOILEDBOT_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: branches
# this lets us do commits and pushes without fiddling with keys
- name: GH cli
working-directory: branches
run: |
gh --version
echo "${{ steps.token.outputs.token }}" | gh auth login --with-token
gh auth status
git config --global user.name "SpoiledBot"
git config --global user.email "github@spoiledcat.net"
- run: ./publish.sh --ispublic $ISPUBLIC --branches --skip-clone --latest $LATEST
if: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }}
working-directory: source
- run: ./pack.sh -c $CONFIGURATION --ispublic $ISPUBLIC
working-directory: source
- run: ./publish.sh --npm --ispublic $ISPUBLIC
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }}
working-directory: source
- uses: actions/upload-artifact@v4
with:
path: 'source/build/**/*.nupkg'
- uses: actions/upload-artifact@v4
with:
path: 'source/build/**/*.tgz'