This repository has been archived by the owner on Sep 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (56 loc) · 1.98 KB
/
ci.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
name: Build and publish snapshot packages
on:
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- "*"
tags:
- "*.*.*"
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- run: |
git fetch --prune --unshallow --tags
echo exit code $?
git tag --list
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- run: ./build.sh build -s true
name: Build
- run: ./build.sh generatepackages -s true
name: Generate local nuget packages
- uses: actions/upload-artifact@v2
with:
name: nuget-packages
path: build/output/*
- run: ./build.sh validatepackages -s true
name: Validate *.npkg files that were created
- name: Publish packages to GitHub package repository
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads/main')
shell: bash
run: |
OWNER=$GITHUB_REPOSITORY_OWNER
NUGET_REPO="https://nuget.pkg.github.com/$OWNER/index.json"
dotnet nuget add source --username $OWNER --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "$NUGET_REPO"
dotnet nuget push 'build/output/*.nupkg' -s github -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols true
delete-stale-pre-release-packages:
runs-on: ubuntu-18.04
needs: build
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads/main')
strategy:
matrix:
# Is this list the same as the nuget packages generated in opensearch-net-abstractions repo?
package: [OpenSearch.OpenSearch.Ephemeral, OpenSearch.OpenSearch.Managed, OpenSearch.OpenSearch.Xunit, OpenSearch.Stack.ArtifactsApi]
steps:
- uses: actions/delete-package-versions@v3
with:
package-name: ${{ matrix.package }}
min-versions-to-keep: 1
delete-only-pre-release-versions: "true"