Skip to content

Commit

Permalink
Fix release-main action (#74)
Browse files Browse the repository at this point in the history
* Add nuget source

* Add NuGet config

* Fixup

* Simplify workflow
  • Loading branch information
stevejgordon authored Mar 27, 2024
1 parent c9efd9c commit 60876d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ jobs:
- run: ./build.sh release --test-suite=skip-e2e
name: Release

- name: generate build provenance
- name: Generate build provenance
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/${{ env.RELEASE_PACKAGES }}"

- name: publish canary packages github package repository
- name: Publish canary packages github package repository
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 '${{ env.RELEASE_PACKAGES }}' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -k ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/elastic/index.json" --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 '${{ env.RELEASE_PACKAGES }}' -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 to feedz.io
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -k ${{ secrets.FEEDZ_IO_API_KEY }} --source https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- run: ./build.sh release --test-suite=skip-all
name: Release

- name: generate build provenance
- name: Generate build provenance
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/${{ env.RELEASE_PACKAGES }}"
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Release to Nuget (only for release events)
if: ${{ github.event_name == 'release' }}
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -k ${REPO_API_KEY} --source ${REPO_API_URL} --skip-duplicate --no-symbols

- if: ${{ success() && github.event_name == 'release' }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
Expand Down
6 changes: 6 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

0 comments on commit 60876d4

Please sign in to comment.