Skip to content

ci: remove unused step for attesting build provenance #47

ci: remove unused step for attesting build provenance

ci: remove unused step for attesting build provenance #47

Workflow file for this run

name: Publish NuGet packages
# Controls when the action will run.
on:
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
packages: write
id-token: write
attestations: write
env:
YumeChan_PluginsLocation: build
jobs:
build-test:
name: Build and Test
strategy:
fail-fast: true
matrix:
# Projects to publish
project: [
{ name: "Base", path: "YumeChan.PluginBase/YumeChan.PluginBase.csproj" },
{ name: "Database.MongoDB", path: "YumeChan.PluginBase.Database.MongoDB/YumeChan.PluginBase.Database.MongoDB.csproj" },
{ name: "Database.Postgres", path: "YumeChan.PluginBase.Database.Postgres/YumeChan.PluginBase.Database.Postgres.csproj" },
]
uses: ./.github/workflows/build.yml
with:
project-path: ${{ matrix.project.path }}
artifact-name: ${{ matrix.project.name }}
publish-nuget:
name: Publish NuGet package
runs-on: ubuntu-latest
needs:
- build-test
strategy:
fail-fast: false
matrix:
# Projects to publish
project: [
{ name: "Base", path: "YumeChan.PluginBase/YumeChan.PluginBase.csproj" },
{ name: "Database.MongoDB", path: "YumeChan.PluginBase.Database.MongoDB/YumeChan.PluginBase.Database.MongoDB.csproj" },
{ name: "Database.Postgres", path: "YumeChan.PluginBase.Database.Postgres/YumeChan.PluginBase.Database.Postgres.csproj" },
]
# Sources to publish to
nuget: [
{ name: "NuGet", source: "https://api.nuget.org/v3/index.json", keyname: "NUGET_TOKEN" },
{ name: "GitHub Packages", source: "https://nuget.pkg.github.com/YumeChan-DT", keyname: "GITHUB_TOKEN" }
]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0
- name: Setup NuGet CLI
uses: NuGet/setup-nuget@v2
- uses: dotnet/nbgv@v0.4
id: nbgv
- name: Restore dependencies
run: dotnet restore ${{ matrix.project.path }}
- name: Build & Pack
run: dotnet pack -c Release --include-symbols ${{ matrix.project.path }} -o "${{ env.YumeChan_PluginsLocation }}"
# - name: Attest build provenance for .(s)nupkgs
# uses: actions/attest-build-provenance@v1
# # Only once per package: take nuget provider
# if: matrix.nuget.name == 'NuGet'
# with:
# subject-path: "**/*.nupkg"
# #subject-path: "**/Release/*nupkg"
# Publish
- name: Publish packages to ${{ matrix.nuget.name }}
run: |
dotnet nuget push "${{ env.YumeChan_PluginsLocation }}/**/*.nupkg" \
--source "${{ matrix.nuget.source }}" \
--symbol-source "${{ matrix.nuget.source }}" \
--api-key "${{ secrets[matrix.nuget.keyname] }}" \
--symbol-api-key "${{ secrets[matrix.nuget.keyname] }}" \
--skip-duplicate