-
-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (119 loc) · 4.57 KB
/
Copy pathpublish.yml
File metadata and controls
140 lines (119 loc) · 4.57 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Builds a final release version and pushes to nuget.org
# whenever a release is published.
# Requires: secrets.NUGET_API_KEY
name: publish
on:
release:
types: [prereleased, released]
env:
DOTNET_NOLOGO: true
Configuration: Release
PackOnBuild: true
GeneratePackageOnBuild: true
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MSBUILDTERMINALLOGGER: auto
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
- name: ⚙️ dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: ⏬ download
run: |
mkdir obj
curl https://download-chromium.appspot.com/dl/Win_x64?type=snapshots -L -o obj/win-x64.zip
unzip obj/win-x64.zip -d src/chromium.win-x64
echo Chromium build https://crrev.com/$(curl --silent https://download-chromium.appspot.com/rev/Win_x64?type=snapshots | grep -oP "\d{6,}") > src/chromium.win-x64/readme.md
curl https://download-chromium.appspot.com/dl/Win?type=snapshots -L -o obj/win-x86.zip
unzip obj/win-x86.zip -d src/chromium.win-x86
echo Chromium build https://crrev.com/$(curl --silent https://download-chromium.appspot.com/rev/Win?type=snapshots | grep -oP "\d{6,}") > src/chromium.win-x86/readme.md
curl https://download-chromium.appspot.com/dl/Linux_x64?type=snapshots -L -o obj/linux-x64.zip
unzip obj/linux-x64.zip -d src/chromium.linux-x64
echo Chromium build https://crrev.com/$(curl --silent https://download-chromium.appspot.com/rev/Linux_x64?type=snapshots | grep -oP "\d{6,}") > src/chromium.linux-x64/readme.md
find ./src/*/*/locales/ -type f -name "*.pak" -not -name "en-US.pak" -delete
rm ./src/*/chrome-win/interactive_ui_tests.exe
- name: 🙏 build runtimes
run: dotnet build -m:1 -bl:runtimes.binlog ./src/Runtimes.sln
- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog
- name: 🐛 logs
uses: actions/upload-artifact@v4
if: runner.debug && always()
with:
name: logs
path: '*.binlog'
- name: ⬆️ upload
if: success()
uses: actions/upload-artifact@v4
with:
name: pkg
path: bin/*
test:
needs: build
name: test-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: ⬇️ artifacts
uses: actions/download-artifact@v4
with:
name: pkg
path: bin
- name: 🧪 test
shell: pwsh
run: |
$fileName = gci -path ./bin -file | where { $_.name -like "chromium.*" } | select -first 1 -ExpandProperty name
$version = $fileName -replace '^chromium\.' -replace '\.nupkg$'
$source = join-path "${{ github.workspace }}" "bin"
dotnet nuget add source $source
dotnet tool install -g dotnet-chromium --version $version
chromium --headless --no-sandbox https://api.ipify.org
push:
needs: test
if: success()
runs-on: ubuntu-latest
steps:
- name: ⬇️ artifacts
uses: actions/download-artifact@v4
with:
name: pkg
path: bin
- name: ⚙️ dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 🚀 sleet
env:
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
if: env.SLEET_CONNECTION != ''
run: |
dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r)
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
publish:
needs: push
if: success()
runs-on: ubuntu-latest
steps:
- name: ⬇️ artifacts
uses: actions/download-artifact@v4
with:
name: pkg
path: bin
- name: 🚀 nuget
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
if: ${{ env.NUGET_API_KEY != '' && github.event.action != 'prereleased' }}
working-directory: bin
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate