Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Make it aware of .NET artifact paths #25

Merged
merged 1 commit into from
Jan 18, 2024
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
141 changes: 71 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,79 @@
name: Always be deploying

on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- main
tags:
- "*.*.*"
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- main
tags:
- "*.*.*"

jobs:
test-windows:
runs-on: windows-latest
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: |
8.0.x
6.0.x
source-url: https://nuget.pkg.github.com/elastic/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: build.bat test
shell: cmd
name: Test
test-windows:
runs-on: windows-latest
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: |
8.0.x
6.0.x
source-url: https://nuget.pkg.github.com/elastic/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: build.bat test
shell: cmd
name: Test

build:
runs-on: ubuntu-latest
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:
# .NET 7 is sadly required for the licenses check tool
# https://github.com/tomchavakis/nuget-license/issues/200
dotnet-version: |
6.0.x
7.0.x
8.0.x
source-url: https://nuget.pkg.github.com/elastic/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

build:
runs-on: ubuntu-latest
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:
# .NET 7 is sadly required for the licenses check tool
# https://github.com/tomchavakis/nuget-license/issues/200
dotnet-version: |
6.0.x
7.0.x
8.0.x
source-url: https://nuget.pkg.github.com/elastic/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: ./build.sh release
name: Release

- name: publish canary packages github package repository
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
shell: bash
run: |
until dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols; do echo "Retrying"; sleep 1; done;
- run: ./build.sh release
name: Release

# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols
name: publish canary packages to feedz.io
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/heads')
- name: publish canary packages github package repository
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
shell: bash
# this is a best effort to push to GHPR, we've observed it being unavailable intermittently
continue-on-error: true
run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols

# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
- run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols
name: publish canary packages to feedz.io
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/heads')

- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
name: release to nuget.org
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/tags')
- run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
name: release to nuget.org
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/tags')
Loading