Skip to content

Workflow file for this run

name: Create NuGet and GitHub Release
on:
pull_request:
types:
- closed
workflow_dispatch:
push:
branches: ["feat/automated-release"]
permissions:
contents: write
### TODO: Replace instances of './.github/workflows/' w/ `auth0/dx-sdk-actions/workflows` and append `@latest` after the common `dx-sdk-actions` repo is made public.
### TODO: Also remove `get-prerelease`, `get-release-notes`, `get-version`, `nuget-publish`, `release-create`, and `tag-exists` actions from this repo's .github/actions folder once the repo is public.
### TODO: Also remove `nuget-release` workflow from this repo's .github/workflows folder once the repo is public.
jobs:
build:
name: Build
runs-on: windows-latest
environment: 'release'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Install .NET
uses: actions/setup-dotnet@v3
- name: Install .NET Android and iOS workload
run: dotnet workload install android ios
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet
run: nuget restore Auth0.OidcClient.All.sln
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Build
run: msbuild Auth0.OidcClient.All.sln -t:rebuild -verbosity:diag -property:Configuration=Release
- uses: actions/upload-artifact@v4
with:
name: build
path: './src'
retention-days: 1
compression-level: 9
generate-docs:
name: Generate API docs
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: ubuntu-latest
environment: release
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: './src'
name: build
- name: Install DocFX
run: dotnet tool install -g docfx
- name: Build docs
run: ./tools/build-docs.sh
shell: bash
- uses: actions/upload-pages-artifact@v2
with:
path: docs
release-android-x:
name: Release AndroidX
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: ubuntu-latest
environment: release
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: './src'
name: build
- id: release_androidx
uses: ./.github/actions/nuget-release
with:
dotnet-version: 6.0.x
project-path: "src/Auth0.OidcClient.AndroidX"
tag-prefix: 'androidx-'
nuget-directory: ${{ github.workspace}}/nuget
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
release-ios:
name: Release iOS
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: ubuntu-latest
environment: release
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: './src'
name: build
- id: release_ios
uses: ./.github/actions/nuget-release
with:
dotnet-version: 6.0.x
project-path: "src/Auth0.OidcClient.iOS"
tag-prefix: 'ios-'
nuget-directory: ${{ github.workspace}}/nuget
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Deploy job
deploy-docs:
# Add a dependency to publish-nuget job
needs: generate-docs
name: Deploy API docs
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
# uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action
run: echo "Hello"