forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.83 KB
/
feedz-push.yml
File metadata and controls
56 lines (49 loc) · 1.83 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
name: A Feedz Publish
on: workflow_dispatch
env:
FEED_URL: https://f.feedz.io/servicestack/pre-release/nuget/index.json
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Setup .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.*'
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: pre-release-pack.yml
# workflow_conclusion: success
name: ServiceStack Packages
commit: ${{ github.sha }}
path: ./build/staging
- name: Check output
working-directory: ./build
run: |
cd staging
export number_of_packages=$(ls -1 | wc -l)
echo "number_of_packages=${number_of_packages}" >> $GITHUB_ENV
dotnet nuget add source ${{ env.FEED_URL }} -n pre-release -u pre-release -p ${{ secrets.FEEDZ_TOKEN }} --store-password-in-clear-text
- name: Clear packages
working-directory: ./build/staging
shell: bash
run: |
ls -1 | grep .nupkg$ | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+).nupkg$/\1 \2/' | while read line
do
dotnet nuget delete ${line} --source ${{ env.FEED_URL }} --api-key ${{ secrets.FEEDZ_TOKEN }} --non-interactive || true
done
- name: Push to GitHub
working-directory: ./build/staging
run: |
# Check if more than 73 packages
if [[ ${number_of_packages} -gt 73 ]]; then
echo "Publishing to Azure Artifacts"
dotnet nuget push '*.nupkg' --source ${{ env.FEED_URL }} --api-key ${{ secrets.FEEDZ_TOKEN }} --skip-duplicate
else
echo 'Less files than expected, skipping push'
exit 1
fi