nuget_update #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) eBPF for Windows contributors | |
# SPDX-License-Identifier: MIT | |
# This workflow updates NuGet packages and creates a pull request with the changes. | |
name: nuget_update | |
on: | |
# Allow this workflow to be manually triggered. | |
workflow_dispatch: | |
# Run this once a week on saturday at 9pm UTC. | |
schedule: | |
- cron: '0 21 * * 6' | |
permissions: | |
contents: read | |
jobs: | |
update: | |
permissions: | |
contents: write # for Git to git push | |
pull-requests: write # for PR creation | |
env: | |
# Path to the solution file relative to the root of the project. | |
SOLUTION_FILE_PATH: ebpf-for-windows.sln | |
BUILD_ARTIFACT_NAME: Build-x64 | |
BUILD_CONFIGURATION: Release | |
BUILD_PLATFORM: x64 | |
runs-on: windows-2022 | |
steps: | |
# Check out the main repo. | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
# Only check out main repo, not submodules. | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- name: Cache nuget packages | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 | |
env: | |
cache-name: cache-nuget-modules | |
with: | |
path: packages | |
key: ${{ runner.os }}-${{env.BUILD_PLATFORM}}-${{env.BUILD_CONFIGURATION}}-${{env.BUILD_ARTIFACT_NAME}}-${{ hashFiles('**/packages.config') }} | |
- name: Restore NuGet packages | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: nuget restore -noninteractive -verbosity detailed ${{env.SOLUTION_FILE_PATH}} | |
# Update nuget packages used by the solution. | |
- name: Update NuGet packages | |
run: | | |
nuget update -noninteractive -verbosity detailed ${{env.SOLUTION_FILE_PATH}} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update NuGet packages | |
title: Update NuGet packages | |
body: | | |
This is an automated pull request by the GitHub Action 'nuget_update'. | |
Please review the changes and merge if appropriate. | |
labels: | | |
automated pr | |
nuget update | |
branch: nuget_update_${{ hashFiles('**/packages.config') }} | |
base: ${{ github.event.workflow_run.head_branch }} |