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

github-action: add provenance #373

Merged
merged 1 commit into from
Apr 11, 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
20 changes: 17 additions & 3 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ env:
jobs:
release:
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

Expand All @@ -29,8 +31,13 @@ jobs:
- name: Inspect public API change
run: ./build.sh generateapichanges -s true

- name: generate build provenance
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/build/output/*.nupkg"

- name: Prepare feedz.io
uses: hashicorp/vault-action@v2.4.2
uses: hashicorp/vault-action@v3.0.0
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
Expand All @@ -50,6 +57,13 @@ jobs:
run: |
until dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols -s https://nuget.pkg.github.com/elastic/index.json; do echo "Retrying"; sleep 1; done;

- name: Store artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: nupkg
path: build/output/*.nupkg

- if: ${{ failure() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
with:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest

permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

Expand All @@ -34,8 +35,13 @@ jobs:
- name: Create or update release for tag on github
run: ./build.sh createreleaseongithub -s true --token ${{ secrets.GITHUB_TOKEN }}

- name: generate build provenance
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/build/output/*.nupkg"

- name: Prepare Nuget
uses: hashicorp/vault-action@v2.4.2
uses: hashicorp/vault-action@v3.0.0
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
Expand All @@ -48,6 +54,13 @@ jobs:
- name: Release to Nuget
run: dotnet nuget push 'build/output/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols

- name: Store artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: nupkg
path: build/output/*.nupkg

- if: ${{ success() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
with:
Expand Down
Loading