Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 67 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
MSBUILDTERMINALLOGGER: auto

jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
Expand Down Expand Up @@ -60,17 +60,76 @@ jobs:
name: logs
path: '*.binlog'

- 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
- 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 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: 🚀 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"
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