Skip to content

Release

Release #82

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [Build]
types:
- completed
branches: [main, v*]
jobs:
release_nuget_to_github_packages:
name: Release
runs-on: ubuntu-latest
environment: GitHubPackages
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
package:
- ActiveLogin.Authentication.BankId.Api
- ActiveLogin.Authentication.BankId.Core
- ActiveLogin.Authentication.BankId.AspNetCore
- ActiveLogin.Authentication.BankId.AzureKeyVault
- ActiveLogin.Authentication.BankId.AzureMonitor
- ActiveLogin.Authentication.BankId.QRCoder
- ActiveLogin.Authentication.BankId.UAParser
steps:
- name: 'Download artifact'
uses: actions/github-script@v5
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "activelogin-authentication-nuget-windows"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/artifact.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
run: unzip artifact.zip
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
- name: Add GitHub NuGet source
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ActiveLogin/index.json"
- name: Push NuGet packages
run: dotnet nuget push "ci/${{ matrix.package }}.?.*.nupkg" --skip-duplicate --source "github"