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

action: support provenance in the pre-release workflow #73

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 14 additions & 5 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,42 @@ on:
branches: [ "main" ]

permissions:
contents: write
issues: write
packages: write
contents: read

env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
RELEASE_PACKAGES: ".artifacts/package/release/*.nupkg"

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v4

- name: Bootstrap Action Workspace
id: bootstrap
uses: ./.github/workflows/bootstrap

- run: ./build.sh release --test-suite=skip-e2e
name: Release

- 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
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
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -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
- 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')

5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_CHANNEL: "#apm-agent-dotnet"
RELEASE_PACKAGES: ".artifacts/package/release/*.nupkg"

jobs:
release:
Expand All @@ -33,7 +34,7 @@ jobs:
- name: generate build provenance
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/.artifacts/package/release/*.nupkg"
subject-path: "${{ github.workspace }}/${{ env.RELEASE_PACKAGES }}"

- name: Prepare Nuget
uses: hashicorp/[email protected]
Expand All @@ -48,7 +49,7 @@ jobs:

- name: Release to Nuget (only for release events)
if: ${{ github.event_name == 'release' }}
run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols
run: dotnet nuget push '${{ env.RELEASE_PACKAGES }}' -k ${REPO_API_KEY} -s ${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